Select record from list box to make current

P Zero

Registered User.
Local time
Today, 00:43
Joined
Mar 15, 2006
Messages
41
Hi. First of all, this is my first post, so tell me if I'm being stupid.

I have a simple form, 'BuildingID', which contains a list box and two buttons. The list box lists a field from the records in the table 'BuildingID'. The two buttons are 'Add Building' and 'Delete Building'. The 'Add Building' button works fine, but I cant figure out how to make the other one work.

I want to be able to single click one of the records in the list box, then hit the 'Delete Building' button to delete the entire record. So I'm guessing I have to somehow make the record that I click on in the list box current when I click on it, then have a standard delete record button.

If anyone can help I would be very greatful. :)
 
In your delete query in the building column type this in the criteria section
Forms![yourform]![yourlistbox]

When yo click the delete button call the delete query and it will take the value from the list box and delete the record
 
I would like to make a button which would select all the entries in a list box...but I'm not sure how to.
is its with
me.lstbox.itemselect or
me.lstbox.selected or something else

tnx

D
 

Users who are viewing this thread

Back
Top Bottom