A
alex
Hello experts,
Using Access ’03…
I have the following code attached to a form:
Private Sub cmd_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryKeyWord", acViewNormal
DoCmd.SetWarnings True
DoCmd.OpenForm "frmResponse", acNormal
DoCmd.Close acForm, Me.Name
End Sub
The aforementioned query is a parameter query and frmResponse opens
fine if the query returns a result. If the query’s recordset is null,
however, I receive a code error as the form opens and attempts to set
the focus and selstart.
I need to modify this code to evaluate the results of qryKeyWord.
If the results of the query yield no results:
msgbox “String not found!”
else
DoCmd.OpenForm "frmResponse", acNormal
DoCmd.Close acForm, Me.Name
Any help would be appreciated.
alex
Using Access ’03…
I have the following code attached to a form:
Private Sub cmd_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryKeyWord", acViewNormal
DoCmd.SetWarnings True
DoCmd.OpenForm "frmResponse", acNormal
DoCmd.Close acForm, Me.Name
End Sub
The aforementioned query is a parameter query and frmResponse opens
fine if the query returns a result. If the query’s recordset is null,
however, I receive a code error as the form opens and attempts to set
the focus and selstart.
I need to modify this code to evaluate the results of qryKeyWord.
If the results of the query yield no results:
msgbox “String not found!”
else
DoCmd.OpenForm "frmResponse", acNormal
DoCmd.Close acForm, Me.Name
Any help would be appreciated.
alex