Trouble with If statement

RitaMoloney

Registered User.
Local time
Today, 10:51
Joined
May 6, 2004
Messages
50
Hi,
I am having problems with an If statement and was wondering if anyone could help me out with it.

What I am trying to do is; If UnitsInStock is 0 (maybe this should be null not 0) Then show a Message.
Or Else
If UnitsInStock is greater than 0 but less than or equal to ReOrderLevel Then Show a different Message.


If UnitsInStock.Value = 0 Then
MsgBox "Out of Stock!" & Chr(13) & "Please Re-Order Stock. " & Chr(13) & " ", vbOKOnly + vbCritical, "Re-Order Stock"
Else
If Me.UnitsInStock.Value > 0 <= Me.ReOrderLevel.Value Then
MsgBox "The Store is running low on stock!!" & Chr(13) & " Please return to Orders to re-order as soon as possible.", vbInformation, "Need to Re-Order Stock"
End If
End If


Thanks for your help
 
Code:
If Me.UnitsInStock = 0 Then
    MsgBox "Out of Stock!" & Chr(13) & "Please Re-Order Stock. ",vbCritical, "Re-Order Stock"
Else
    If Me.UnitsInStock > 0 And Me.UnitsInStock <= Me.ReOrderLevel Then
        MsgBox "The Store is running low on stock!!" & Chr(13) & " Please return to Orders to re-order as soon as possible.", vbInformation, "Need to Re-Order Stock"
    End If
End If
 
Hi,

That worked. So easy when someone else shows you.
Thanks a million for your help.

Rita
 

Users who are viewing this thread

Back
Top Bottom