Select/Update query

  • Thread starter Thread starter ploddinggaltn
  • Start date Start date
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
 
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.
 
Back
Top