I’m moving from VB to Access for creating front ends. One of the things I would commonly do in VB is build a SQL string based on controls. I would then create a records set. Simple enough.
Now in Access I want to pass parameters to a query from a form, run the query, and then produce a report based on the query. Calling a single control’s value is pretty straight forward, but what if I want to loop through a series of controls and then pass the values? How do I do that?
For instance, I have a half dozen unbounded check boxes and for each one that is checked I want to query on it. The string might end up looking like this
((Table.Status)="2" Or (Table.Status)="3" Or (Table.Status)="5")
I can build that string in code no problem. If it’s stored in a variable, how do I pass it to the query? In this case do I just build the query string, create a DAO record set, and then set the reports RecordSource to the record set?
Thanks in advance.
Now in Access I want to pass parameters to a query from a form, run the query, and then produce a report based on the query. Calling a single control’s value is pretty straight forward, but what if I want to loop through a series of controls and then pass the values? How do I do that?
For instance, I have a half dozen unbounded check boxes and for each one that is checked I want to query on it. The string might end up looking like this
((Table.Status)="2" Or (Table.Status)="3" Or (Table.Status)="5")
I can build that string in code no problem. If it’s stored in a variable, how do I pass it to the query? In this case do I just build the query string, create a DAO record set, and then set the reports RecordSource to the record set?
Thanks in advance.