Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic question, using the combo selection to run a query

Status
Not open for further replies.

ErikZ

Programmer
Feb 14, 2001
266
US
I have a table with "names" and "addresses". I have a combo box the names. When I select the name I want a query to run on the table and show me the name and address.

That was the example I came up with so I understand how to do it, in reality my problem is this:

In a table, I have a join table, a key column, a "people" column, a "job" column.

On the form I have two combo boxes, "People", and "Job". I want the user to be able to select the person and job, and have access look it up on the table, if it exists, the user will then delete it. If it doesn't, I'm going to figure out how to add a descriptive error message.
 
Erikz,
create a delete query based off that table and have the criteria for the people field = [Forms]![yourFormName]![PeopleComboBox] and the criteria for the job field = [Forms]![yourFormName]![JobComboBox]

Place a button on the form and have the onclick event of the button call the delete query.

Hope this helps...finny
 

That's strange. Well, first, Thanks for your help! Even though I thought I tried this yesterday, it works now.

Second I found out that if you use the command button wizard to run the query, it won't let you choose the delete query! You have to go into the code and change it yourself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top