Sabtu, 16 Juli 2011

RE: [MS_AccessPros] Opening reports through Option Group

 

Khalid-

Why do you need to run ReportNamesDelete and ReportNamesToTable when the form
opens?

If you have an option group, you need a command button to trigger opening the
correct report after the user picks the report wanted in the group. The code
behind the command button might look like:

Private Sub cmdOpenReport_Click()
' Check the option wanted
If Me.optReport = 1 Then
' Open All projects
DoCmd.OpenReport "Employees Category Wise All Projects", acViewPreview
Else
' Open selective
DoCmd.OpenReport " Employees Category Wise Selective Project",
acViewPreview
End If
End Sub

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Khalid Tanweer
Sent: Saturday, July 16, 2011 1:45 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Opening reports through Option Group

Hi John,
Hope you doing well. Long ago you gave me procedures to automatically populate
Report Names in a form "All Reports" and if any report is deleted it is
automatically deleted from the form. Every thing is working there smoothly.
Now i have come to a situation that if i had two reports:

"Employees Category Wise All Projects"
"Employees Category Wise Selective Project"

I have created a form "Select your choice" having option Group for the above two
reports. This form works and opens both reports simultaneously.

My question is that, what should i do for the report names residing in form "All
Reports", and on form "All Reports" On Open event this code is running:

Private Sub Form_Open(Cancel As Integer)
'This provides an informative and professional
' appearance to our Form Title Bar
Me.Caption = " Report Date Manager" & _
"Today is " & Format(Date, "dddd"", ""d/m/yyyy")

' We call these two Procedures to get the
' current Report Names in our table
ReportNamesDelete
ReportNamesToTable
End Sub

Now where should i place this form "Select your choice". Please also suggest is
this a good practice to make these type of forms asking user to select his
choice from Option Group, or keeping all report names in form "All Reports" is
better. I am thinking that if i make such forms asking user to select his choice
would reduce the number of reports in form "All Reports"

Regards,
Khalid Tanweer

------------------------------------

Yahoo! Groups Links

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar