Results 1 to 2 of 2
Thread: 2002: Form design question
2009-08-28, 11:40 #1
- Join Date
- Feb 2003
- Thanked 0 Times in 0 Posts
I need help designing a form that will be used to define filter criteria for a report.
I'd like to have a main form with a subform in datasheet view. The user would use filter by form (subform) to select the data they'd like to see in the report. I'd have a button on the main form that allows the user to generate a report displaying the filtered data selected in the datasheet subform.
Can I get to the datasheet subform's recordsource and filter (set by filter by form) as a string in VBA? I was thinking if I can get to the SQL strings, I could store them in a public variable and pass it to the report during the On Open event. I'm sure there's a standard way of doing such a thing, just can't seem to find an example.
Any help would be greatly appreciated...
2009-08-28, 16:23 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
RecordSource and Filter are both string properties of a form.
You can use the OpenArgs argument of DoCmd.OpenReport to pass a string to the report that can be used in the On Open event of the report: Me.OpenArgs will contain the string.