Combo Box with a click button

Quantarama

New member
Local time
Yesterday, 18:16
Joined
Nov 18, 2010
Messages
5
Hi all,
I have a question regarding the combo box : As per normal there will be a few drop downs to select from.
And then there will be a click button, which will then pull up a corresponding query depending upon which option they selct in the combo box.
Basically the idea is depending upon the value in the combo box, the click button will pull up a different query.
Can this be easily done ? Or do I need some code for it ?

Thanks
 
Yes, in the On Click event of your button put something like;
Code:
If Me.ComboName = 1 Then
     DoCmd.[URL="http://msdn.microsoft.com/en-us/library/aa220295%28v=office.11%29.aspx"]OpenQuery[/URL] "QryName1"
ElseIf Me.ComboName = 2 Then
     DoCmd.OpenQuery "QueryName2"
Else
     DoCmd.OpenQuery "QueryName3"
End If
Insert the appropriate number of ElseIf clause.
 
Many Thanks John, that was exactly what I was after
 

Users who are viewing this thread

Back
Top Bottom