Options Groups

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Originally I had asked for help in setting date parameters on a couple of my reports

One of you brilliant folks walked me through creating an unbound form called frmWhatDates It had two test boxes names txtStartDate and txtEndDate, etc. Two command buttons OK and Cance. I pasted code to the OK button. If you need more info than this I'll elaborate more but hopefully you get the drift -- I believe I was tagging with Allen Browne at the tim

I created several of these forms for different reports as I was unable to set up an option group

I was unable to add an Option Group at the time due to corrupted files. That is fixed now and I would like to know how to use that singular form to list all the reports that I have that are date driven to be previewed and then printed. I've been playing with the option Group wizard but I apparently don't get it

The original correspondence was "date parameter prompts on reports" dated 1/5/04 through 1/7/04
 
What do you want to do with the option group? If you want to select a
report, I suggest that you create a table of reports with the report object
name, title, description, and whatever else. You can then display the titles
of the reports in a list box.

--
Duane Hookom
MS Access MVP


René said:
Originally I had asked for help in setting date parameters on a couple of my reports.

One of you brilliant folks walked me through creating an unbound form
called frmWhatDates It had two test boxes names txtStartDate and txtEndDate,
etc. Two command buttons OK and Cance. I pasted code to the OK button. If
you need more info than this I'll elaborate more but hopefully you get the
drift -- I believe I was tagging with Allen Browne at the time
I created several of these forms for different reports as I was unable to set up an option group .

I was unable to add an Option Group at the time due to corrupted files.
That is fixed now and I would like to know how to use that singular form to
list all the reports that I have that are date driven to be previewed and
then printed. I've been playing with the option Group wizard but I
apparently don't get it.
The original correspondence was "date parameter prompts on reports" dated
1/5/04 through 1/7/04
 
What I would like to do is have one form that will set date parameters exactly like I have right no

BUT -- I was picturing having all of the reports that are date driven listed on the form with option buttons or check boxes and which ever report was clicked, would be the report that would come up when you clicked OK on the date parameter form. If that made sense

In the original conversation Mr. Brown said that I could use this form(ie. the fromWhatDates form) for "all sorts of reports. You may add an option group or list box that selects which report you want printed and a check box that determines whether the report should be opened in preview mode

I may have misunderstood, but that sounds like what I want, I just don't know how to d

Thanks ahea
 
Assuming you have
- a from with your date text boxes
- a table similar to what I have suggested
- the primary key of the table of reports is the ReportObjectName
Use the list box wizard to add a list box that is based tblReports. Select
the ReportObjectName and ReportTitle fields. Save the list box with a name
of lboReport. This should create a list box that displays the report titles
but references the ReportObjectName.

You can then use code for a command button like:
Dim strWhere as String
strWhere = "1=1 "
If Not IsNull(Me.txtStartDate) Then
strWhere = strWhere & " And [DateField] >=#" & _
Me.txtStartDate & "#"
End If
If Not IsNull(Me.txtEndDate) Then
strWhere = strWhere & " And [DateField] <=#" & _
Me.txtEndDate & "#"
End If
If not IsNull(Me.lboReport) Then
DoCmd.OpenReport Me.lboReport, acPreview, , strWhere
End If


--
Duane Hookom
MS Access MVP


René said:
What I would like to do is have one form that will set date parameters exactly like I have right now

BUT -- I was picturing having all of the reports that are date driven
listed on the form with option buttons or check boxes and which ever report
was clicked, would be the report that would come up when you clicked OK on
the date parameter form. If that made sense.
In the original conversation Mr. Brown said that I could use this form(ie.
the fromWhatDates form) for "all sorts of reports. You may add an option
group or list box that selects which report you want printed and a check box
that determines whether the report should be opened in preview mode"
 
Back
Top