Link a combo box with update query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Let me start by saying I am brand new to access, I have taken a introduction
to database class. I made a unbound combo box and typed in a list of update
queries that I have. How can I link them to one command button after a
selection is made? Or can this even be done? Please try and keep it simple,
I know next to nothing about writing code. Thanks for any help I can get.
 
In the Click event of the command button, run the query that is currently
selected in the combo box:

Private Sub cmdButton_Click()
' If a query is selected
If cboQueries.ListIndex > -1 Then
' Execute the query
DoCmd.RunSQL cboQueries
End If
End Sub

Be sure to use your own control names in place of the ones I've made up.

Carl Rapson
 

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

Similar Threads

Combo box help 1
Combo box / Query 1
"Reset" combo boxes 4
Combo box headache 5
my combo boxes 2
Combo Box question. 3
Combo box - not in list 2
Adding Combo Box Access 2003 - problems 2

Back
Top