IF then statement help

kidrobot

Registered User.
Local time
Today, 14:32
Joined
Apr 16, 2007
Messages
409
I need help with an If then statement for my SQL code. I have no idea on syntax but I know what I want it to do.

Code:
strSQL= stuff

if NULL
vbOK? "there is no user"
if not null
continue
end if

Any help would be great!!!
 
Code:
set rs = db.openrecordset(strSQL)

if rs.count = 0 then
msgbox("There is no user")
end if
 
Code:
set rs = db.openrecordset(strSQL)

if rs.count = 0 then
msgbox("There is no user")
end if

Sort of, but you missed a couple things.

Code:
Dim rs As DAO.Recordset
Dim db As DAO.Database

Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL, dbReadOnly)

If Not(rs.EOF and rs.BOF) Then
    Select Case Msgbox "There is no user. Would you like to continue?",vbYesNo
        Case vbYes 
        Case vbNo: Exit Sub 'Exit Function
    End Select
End If
 

Users who are viewing this thread

Back
Top Bottom