I need my query to ask you to select a name from a drop down list/list box (instead of asking you to type it in). It should look for the selectable name values in a specific table.
I need my query to ask you to select a name from a drop down list/list box (instead of asking you to type it in). It should look for the selectable name values in a specific table.
Code:
Select * FROM YourTableName WHERE YourFieldName ='" & me.YourTextBoxName & "'" ' if a string
Code:
Select * FROM YourTableName WHERE YourFieldName =" & me.YourTextBoxName ' if an integer
Code:
Select * FROM YourTableName WHERE YourFieldName =#" & me.YourTextBoxName & "#" ' if a date or time
Thank you, though it didn't solve the problem.
Where do I put the code? In a query design view? At least I tried that but resieved an error message saying, check the Syntax and bracket the sub query (or something like that).
Is your query run from a form, that has this Combobox on it with the recordsource set to the table with the list of values.?
It sounds like you want them to select the option from the combobox first.
Then what triggers the requery?
Do they press a command button? or does it requery once the combobox is selected?
Steve
On the combo box AfterUpdate event
me.listboxname = "SELECT . . ." '(the appropriate SQL statement)
me.listboxname.reuqery
After you make the selection in the Combo What exactly do you wish to have occur. I don't follow the assignment of the SQL statement in your example.
Steve
Look at my earlier post in this thread.
I see what you mean with the ComboBox event. I was asking about the query itself. is it a recordsource, or simply being fired to preform some action independent of any GUI.
steve
The original question wasn't mine.
A SQL query, among other things, can be a form or report recordsource or a control rowsource.