Hi,
I have the following code on my form which works as desired:
The problem I am having is the following related code which keeps returning the "Else" statement "Msgbox..........":
So basically it will not open my query. Any ideas why?
I have the following code on my form which works as desired:
Code:
Private Sub Form_Open(Cancel As Integer)
qrycounter = 0
Counter_txt = qrycounter
qrycounter = DCount("[Logid]", "tbllog", "[tbllog].[sitesid] = [forms]![frmsites]![sitesid]")
Counter_txt = qrycounter
End Sub
The problem I am having is the following related code which keeps returning the "Else" statement "Msgbox..........":
Code:
Private Sub open_openqueries_Click()
If qrycounter > 0 Then
DoCmd.OpenQuery "qryview_all_queries", acViewNormal, acReadOnly
Else
MsgBox ("There are no Queries on this Site")
End If
End Sub
So basically it will not open my query. Any ideas why?