G
Guest
I am sure the answer is easy but I don't know it :-( Anyway, how do I write
in VB
the following code:
if whatever and whatever = whatever then
me!whatever = whatever
then, even if the first condition is true I want to check the next control
and do the same thing and so on. In plain English.
if the box 1 is null then
box1a = color red
also
if box 2 is null then
box2a = color red
also
if box3 is null then
bo3a = color red
and so on
So what is the command for "ALSO"?
The real code is a follow:
Private Sub Form_Current()
Dim lngBlack As Long
Dim lngRed As Long, lngYellow As Long, lngWhite As Long
lngRed = RGB(255, 0, 0)
lngBlack = RGB(0, 0, 0)
lngYellow = RGB(255, 255, 0)
lngWhite = RGB(255, 255, 255)
If Not IsNull(Me!tVector.Value) And IsNull(Me!tVectorOK.Value) Then
Me!tVectorOK.BackColor = lngYellow
ElseIf Not IsNull(Me!tNeshap.Value) And IsNull(Me!tNeshapOK.Value) Then
Me!tNeshapOK.BackColor = lngYellow
ElseIf Not IsNull(Me!tPool.Value) And IsNull(Me!tPoolOK.Value) Then
Me!tPoolOK.BackColor = lngYellow
ElseIf Not IsNull(Me!tSeptic.Value) And IsNull(Me!tSepticOK.Value) Then
Me!tSepticOK.BackColor = lngYellow
ElseIf Not IsNull(Me!tMoveoff.Value) And IsNull(Me!tMoveoffOK.Value) Then
Me!tMoveoffOK.BackColor = lngYellow
Else
Exit Sub
End If
End Sub
in VB
the following code:
if whatever and whatever = whatever then
me!whatever = whatever
then, even if the first condition is true I want to check the next control
and do the same thing and so on. In plain English.
if the box 1 is null then
box1a = color red
also
if box 2 is null then
box2a = color red
also
if box3 is null then
bo3a = color red
and so on
So what is the command for "ALSO"?
The real code is a follow:
Private Sub Form_Current()
Dim lngBlack As Long
Dim lngRed As Long, lngYellow As Long, lngWhite As Long
lngRed = RGB(255, 0, 0)
lngBlack = RGB(0, 0, 0)
lngYellow = RGB(255, 255, 0)
lngWhite = RGB(255, 255, 255)
If Not IsNull(Me!tVector.Value) And IsNull(Me!tVectorOK.Value) Then
Me!tVectorOK.BackColor = lngYellow
ElseIf Not IsNull(Me!tNeshap.Value) And IsNull(Me!tNeshapOK.Value) Then
Me!tNeshapOK.BackColor = lngYellow
ElseIf Not IsNull(Me!tPool.Value) And IsNull(Me!tPoolOK.Value) Then
Me!tPoolOK.BackColor = lngYellow
ElseIf Not IsNull(Me!tSeptic.Value) And IsNull(Me!tSepticOK.Value) Then
Me!tSepticOK.BackColor = lngYellow
ElseIf Not IsNull(Me!tMoveoff.Value) And IsNull(Me!tMoveoffOK.Value) Then
Me!tMoveoffOK.BackColor = lngYellow
Else
Exit Sub
End If
End Sub