You'll want to create a form that has a procedure behind its OnOpen event, something like:
Private Sub Form_Open(Cancel As Integer)
Me.RecordSource = Forms!frmMyDialog![SQLstring]
End Sub
In my case, I have another form that prompts the user for various parameters. After the user clicks "Go", I have VBA write a query statement in SQL to a string named SQLstring, which the final form (in my case it's actually a report) uses as its record source.
Perhaps an easy way to do all this is to create a Query that approximates what your final product will call, and use that to create your form. Then you can use the SQL from your Query as a template for your dynamic SQLstring.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.