Link to home
Start Free TrialLog in
Avatar of Blueice13085
Blueice13085Flag for United States of America

asked on

Ms Access VB using if

i am using the if statement   If (StartOdo <= 0) Then. what i need it to check is if StartOdo <=0 or StartOdo is blank, need it to check in one if don't want to use else if etc.
Avatar of Steven Harris
Steven Harris
Flag of United States of America image

...need it to check in one if don't want to use else if etc.
Can you explain a bit further?  What is it exactly that you are trying to do?
Avatar of Blueice13085

ASKER

code reads

        If (StartOdo <= 0) Then
            DoCmd.SetWarnings False
            erg = MsgBox("No Start miles had been set for" & " " & Me.VehicleNumber.Column(0) & "," & " " & Me.OdoAtFillDate & " Miles " & "will be the Start Miles for this Vehicle. No other Data is Needed", vbOKOnly)
            DoCmd.RunSQL (SQL2)
            DoCmd.RunCommand (acCmdDeleteRecord)
            DoCmd.Close
            DoCmd.SetWarnings True

Open in new window



but if StartOdo is blank then it goes to a different statement in my code (no listed here)
so i need it to check it here if StartOdo is blank, less then 0, or = to 0. If StartOdo is blank do above code, StartOdo is is less then 0 or = to 0 do above code.
SOLUTION
Avatar of Steven Harris
Steven Harris
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial