Edit record in list box by double clicking

xcmav66

Registered User.
Local time
Today, 12:43
Joined
Oct 29, 2008
Messages
29
I want to write some code that will change the state of a parameter for a record in a table if I double click on it in the list box. How can I do this?
 
I tried binding the 1st column of the list box (which is populate from a query) to the control, but I still don't know what commands to use to specifically edit a parameter of that record.
 
bump...anyone?
 
Can someone please help here? I need the same information. I am creating a visitor database, which clocks contractors etc in and out of our facility. I would like to change the status from "clocked in" to "clocked out" by double clicking their name in a list box.
 
you would need to use a sql statement something like

update employeetable set status = whatever where employeeid = listboxvalue

you do this by

docmd.runsql statement
or currentdb.execute statement

the statement has to be formatted properly or it will not work

after executing the statement then

listbox.requery will requery the listbox contents (if you are displaying the logged in status.

---------
note that you cant update the listbox directly - the listbox is drawn from a query, and therefore you have to amend the table(s) which underly the query to affect the lsit box.
 

Users who are viewing this thread

Back
Top Bottom