Reputation: 4539
Okay so this is another question about a previous question I asked:
Rookie SQL inside of VB question - MSAccess 2003
I am pretty new at this so I appreciate the help guys!
So lets say I have a form and I want the SQL string in the VB to fill out a form based on parameters selected by the user on the form (combo boxes, etc) and a button click
I know how to add the parameters from the form to the SQL, but how do I get the resulting dataset to populate inside lets say a list box.
Thanks guys!
Upvotes: 2
Views: 194
Reputation: 97101
Set the Row Source Type property for your list box to "Table/Query". Then you can assign your SQL statement to the list box's RowSource property.
Me.lstMyListBox.RowSource = strSQL
... where Me is a pointer to the current form, lstMyListBox is the name of your list box control, and strSQL is a variable which contains your SQL statement.
Put that in the after update event of the form control where the users input/select the parameters.
Upvotes: 2