Select/Update query

P

ploddinggaltn

I don't want the users of my database to have to run queries so I would like
to have it run with a command button. I have the select portion of the query
running fine with the command button...the select is [What school would you
like to update, enter the school number].....but then I'd like to ask [What
hotel would you like to assign to this school]. After they enter the hotel
name, I'd like the query to update those fields. Here is my current code
that Access assigned to the command button

Private Sub cmdOpenBusList_Click()
On Error GoTo Err_cmdOpenBusList_Click

Dim stDocName As String

stDocName = "sqrySchool"
DoCmd.OpenQuery stDocName, acNormal, acEdit



Exit_cmdOpenBusList_Click:
Exit Sub

Err_cmdOpenBusList_Click:
MsgBox Err.Description
Resume Exit_cmdOpenBusList_Click

End Sub
 
R

Ray C

What I would suggest is a form that contains a listbox (of schools) and on
that same form, another listbox of hotels. Have your user select the school
and the hotel and THEN, provide a button that will create the query
dynamically and execute it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top