if condition

abcd_2013

Registered User.
Local time
Today, 12:31
Joined
Dec 7, 2012
Messages
13
is this condition equal each other
is if here have the same way

If Me.Text1 = 5 Then
If Me.Text3 = 10 Then
MsgBox "hi"
End If
End If
=====
If Me.Text1 = 5 And Me.Text3 = 10 Then
MsgBox "hi"
End If
 
I don't think the second way will work. You *might* be able to do something like

IF AND(Me.Text1=5,Me.Text3=10) = True
msgBox "Hi"

but I have never tried it.

But the first way looks right to me
 
is this condition equal each other
is if here have the same way

If Me.Text1 = 5 Then
If Me.Text3 = 10 Then
MsgBox "hi"
Else
MsgBox "bye"
End If
End If

You might also consider an else statement in case the values do not equal the ones indicated. The else statement would tell the program what to do if the conditions aren't met.
 
The two structures are both valid and are equivalent.
 

Users who are viewing this thread

Back
Top Bottom