D
Daniel
I have two combobox combo1and combo2. I need to check that if ANY value
exists in combo1, then run query1, and if ANY value exists in combo2, then
run query2, and if both combo1 and combo2 ANY value exist, then run query3.
Here is what I have and I may be way off.
Dim stDocName As String
If me.combo1 = -1 _
And Me.combo2 = 0 Then
stDocName = "Query1"
DoCmd.OpenQuery stDocName, acNormal, acEdit
ElseIf Me.combo1 = 0 _
And Me.combo2 = -1 Then
stDocName = "Query2"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Else stDocName = "Query3"
DoCmd.OpenQuery stDocName, acNormal, acEdit
End If
I run it and nothing happens. Am I on the right track or do I have a hole
in my head?
Any help would be appreciated!
Daniel
exists in combo1, then run query1, and if ANY value exists in combo2, then
run query2, and if both combo1 and combo2 ANY value exist, then run query3.
Here is what I have and I may be way off.
Dim stDocName As String
If me.combo1 = -1 _
And Me.combo2 = 0 Then
stDocName = "Query1"
DoCmd.OpenQuery stDocName, acNormal, acEdit
ElseIf Me.combo1 = 0 _
And Me.combo2 = -1 Then
stDocName = "Query2"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Else stDocName = "Query3"
DoCmd.OpenQuery stDocName, acNormal, acEdit
End If
I run it and nothing happens. Am I on the right track or do I have a hole
in my head?
Any help would be appreciated!
Daniel