Hi there again folks. Im continuing on from the code posted on SQL Error.
I wish to display a msg box and prevent a new form from opening if it is an empty recordset. The following comes after the SQL Code in the click event
but it still opens a blank white screen as there is no data. Am i on the right path here " If IsNull(qdf.Fiel ds("model")) Then " or is there another method to determine if the query is empty.
Regards panteraboy
I wish to display a msg box and prevent a new form from opening if it is an empty recordset. The following comes after the SQL Code in the click event
Code:
qdf.SQL = strSQL
Dim msg As String
msg = "Sorry there are no models in stock with that specification"
If IsNull(qdf.Fields("model")) Then
MsgBox (msg)
Else
'DoCmd.OpenQuery "Admin_query"
DoCmd.Close acForm, Me.Name
Set qdf = Nothing
Set db = Nothing
DoCmd.OpenForm "laptop_specs", , "Admin_query"
End If
Regards panteraboy
Comment