Update Query and Listbox

da poet

Registered User.
Local time
Today, 17:13
Joined
Aug 23, 2004
Messages
39
Im running an update query but in the criterial field i would like to include something that instructs the query to be executed only on the value selected in my listbox.

i need some help with the syntax cause i dont know how to bound the query's execution to the selected/highlighted value in the listbox.
 
da poet said:
Im running an update query but in the criterial field i would like to include something that instructs the query to be executed only on the value selected in my listbox.

i need some help with the syntax cause i dont know how to bound the query's execution to the selected/highlighted value in the listbox.

Is it a multi-select listobx? If so then you need to get fancy. You can find help with this at www.mvps.org/access in the Forms section.

If the user will make only one selection then use a combobox instead and set the criteria to:

=Forms!formname!controlname
 
The listbox is a multiselect listbox but the bound column is the problem that im having.

I have two listboxes that i drag and drop things from. I would like to run the query which is an update query on only the item selected and dragged as opposed to having the query executed on everything that is in the listbox which is what has been happening

and also, what is the syntax for calling a query to be executed using vb codes?
 
If the listbox is a multi-select then you have to deal with the list box differently. If you only want to deal with one item, use a combobox.

DoCmd.OpenQuery
 

Users who are viewing this thread

Back
Top Bottom