Option Group to Report challenge

D

DubboPete

Hello all,

I have spent the last eight hours scouring the newsgroup trying to find a
solution, and now I am home I can ask for assistance from you peoples!

I need to filter records with data in one of six fields, dependent on the
option group selection, and then create a report with those filtered
records.

The fields are:

Continuum Of Care
Leadership & Management
Information Management
Human Resources Management
Safe Practice and Environment
Service Delivery

All these fields are Yes/No checkboxes on the data entry form on input. On
data entry, users are allowed to check more than one of the above, if the
subject meets more than one criteria.

Obviously I would like these as the choices in the Option Group. I just
cannot work out how to get the recordset to select the particular records if
"Option 1 - Continuum Of Care" is chosen, and then base my report on those
records.

Any help and guidance greatly appreciated! Hope I have provided enough
information.

DubboPete
The list's own 17th Century Goat-Herder
 
A

Allen Browne

This kind of thing should let you select the records using ONE of the
fields:

Dim strField As String
Dim strWhere As String

Select Case Me.[NameOfYourOptionGroupHere]
Case 1
strField = "[Continuum Of Care]"
Case 2
strField = "[Leadership & Management]"
...
End Select

If Len(strField) > 0 Then
strWhere = strField & " = True"
End If

DoCmd.OpenReport "Report1", acViewPreview, , strWhere


Again, the data structure is incorrect, but that's another story.
 
D

DubboPete

Thanks Allen,

that all looks good, and now I have my recordset, but how does one
reference that when creating the new report? what would be the record
source??

Sorry for sounding dumb...

Pete
 
D

DubboPete

Allen

Ignore my last posting, the answer came to me in a vision...

Base the report around the table, include all the fields you want, save
it as 'Report1', then click the option group....

and it worked!

thanks for your help mate!

DubboPete
17th century Goat-Herder
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top