been stumped on this one for days

helloworld

Registered User.
Local time
Today, 13:00
Joined
May 18, 2004
Messages
62
Hey there,

I am not a very experienced VB programmer as some of you guys out there and I really need help with this one. I am trying to open a report and this is the code I got.

DoCmd.OpenReport stDocName, acPreview, , data_criteria & criteria

where data_criteria is one part of the where condition and criteria is a variable derived from which checkbox is clicked. If only one checkbox is clicked, the code works...however if I click two or more, the code does not work..Could someone please help?

thanks
 
You can dynamically build the condition in a string, using AND to join the criteria.

See the code in the On Click event of the command button on the form in the attached database.

On the form, the Triple State properties of the check boxes are set to Yes so that each check box can be Null, checked or unchecked.
 

Attachments

Last edited:
I am looking for how to do this with subreports. I really have no idea, i am not very good with VBA. could someone please point me in the right direction here?

I have 4 different reports that i want to put on one report, so i will have them as my subreports. i want them all to contain some of the same criteria, so i would like to use this form.

Thank You,
 
Can anyone help here? I need to know how to filter my selection down through my subreports. I have everything setup already, the only thing i don't understand would be the coding to make my subreports reflect the selection from the form.

Any help would be appreciated.

Thank You!
 
bionicman said:
Can anyone help here? I need to know how to filter my selection down through my subreports. I have everything setup already, the only thing i don't understand would be the coding to make my subreports reflect the selection from the form.

Any help would be appreciated.

Thank You!


Do you have a sample you could maybe upload?



You need to have something that ties it all together, like a date, that makes it easier.

We use a report here that is made up of 4 subreports tied by name, date or user number depending on the subreport.
Kim
 

Users who are viewing this thread

Back
Top Bottom