Delete query using combo as selection (1 Viewer)

Scythed

Registered User.
Local time
Today, 03:53
Joined
Aug 30, 2008
Messages
28
I am attempting to write a delete query so that once you select an item in a combo box and then hit the delete button, it looks for the Item you have selected then deletes it from a table. This is what I have at the moment but when I run it a popup appears, treating the DeleteUserCombo part as a parameter. Also, I have managed to setup my form with several text boxes so that I can add a new person in by putting their name etc in. I was wondering if it was possible to make it so that once I add someone to the table, it automatically refreshes the combo box so that said person appears in the combo box as well. As it is I have been having to close the form then reopen it in order to refresh the combo box. Any help would be appreciated. Thank You.

DELETE *
FROM [Customer Details Table]
WHERE [Customer Details Table].CustomerID=DeleteUserCombo;
 
Local time
Today, 05:53
Joined
Mar 4, 2008
Messages
3,856
Seems you're going about this backwards. Access bound forms have all that functionality built in (except the combo, which is easy to add with a wizard).

Just create a form based on your table. Then use the wizard to create a combo box and use the option to create a filter. Then when you select a value in your combo box, it will bring up the associated record, allowing the user to delete that record with the delete button.
 

Scythed

Registered User.
Local time
Today, 03:53
Joined
Aug 30, 2008
Messages
28
Thank you for your reply, I did not really understand what you meant but I have simplified the process somewhat using your help. Thank you very much.
 

Users who are viewing this thread

Top Bottom