Combo box for a form to open a query

J

Jim

Does anyone know how to create a combo box on a form that
when choosing from the list, to have it open a
query/report?
 
P

Perry

Here's a simple example of a combobox
opening either Query1 or Query2, present in the project.

Private Sub cboTest_AfterUpdate()
DoCmd.OpenQuery Me.cboTest
End Sub

Private Sub Form_Load()
With Me.cboTest
.RowSourceType = "Value List"
.RowSource = "Query1;Query2"
End With
End Sub

Krgrds,
Perry
 

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