The following code works its way through some simple If...Else...EndIf statements and For...Next statements.
Me.AddDate is Null.
The result of running the code (with the MsgBox "markers") is that the following messages appear (in the order listed):
1) End Add True
2) End Add Checks
3) End Add True
4) End Add Checks
...I would have thought that the message boxes should display:
1) End Add False
2) End Add Checks
What's going on here?!?!
If Not IsNull(Me.AddDate) Then
Dim AddTrue As Control
For Each AddTrue In Me.Controls
If Left(AddTrue.Name, 3) = "Add" Then
AddTrue.Visible = True
End If
Next AddTrue
Me!CheckAdd = True
MsgBox "End Add True"
Else
Dim AddFalse As Control
For Each AddFalse In Me.Controls
If Left(AddFalse.Name, 3) = "Add" Then
AddFalse.Visible = False
End If
Next AddFalse
Me!CheckAdd = False
MsgBox "End Add False"
End If
MsgBox "End Add Checks"
Me.AddDate is Null.
The result of running the code (with the MsgBox "markers") is that the following messages appear (in the order listed):
1) End Add True
2) End Add Checks
3) End Add True
4) End Add Checks
...I would have thought that the message boxes should display:
1) End Add False
2) End Add Checks
What's going on here?!?!
If Not IsNull(Me.AddDate) Then
Dim AddTrue As Control
For Each AddTrue In Me.Controls
If Left(AddTrue.Name, 3) = "Add" Then
AddTrue.Visible = True
End If
Next AddTrue
Me!CheckAdd = True
MsgBox "End Add True"
Else
Dim AddFalse As Control
For Each AddFalse In Me.Controls
If Left(AddFalse.Name, 3) = "Add" Then
AddFalse.Visible = False
End If
Next AddFalse
Me!CheckAdd = False
MsgBox "End Add False"
End If
MsgBox "End Add Checks"