Executing a query on highlighted record in listbox

da poet

Registered User.
Local time
Today, 13:56
Joined
Aug 23, 2004
Messages
39
How do i apply a query that i want to execute only on a highlighted record in a listbox.

If there is a link, sample database or lines of code could you please assist.

Currently everything is being executed on all of the records in the query.


Also Does Access 2000 support codes for drag and drop forms?
 
If I am understanding you correctly, you want to take a specific value from the list box, and then run a query on the rest of your records to find all of the records with the same value?

I would write an SQL statement and put it in the Control Source.

Code:
SELECT DISTINCTROW qryContacts.ContactID, [LastName] & ", " & [FirstName] WHERE (ContactType = [frmContactType])

You could create this in a query, but you'd have to pass on the value somehow. This is a starting point, I've done something similar.
 
The thing is I have two listboxes both of which list the component parts assigned to particular machines.

I wanted to be able to switch components from their assigned machine to another one based on the machines service tag number.

i have an update query which executes to take values from one listbox and place them in another, the only problem (THE PROBLEM) is that the query is executed on all of the components and not just on the ones that are selected in the listbox,.
 

Users who are viewing this thread

Back
Top Bottom