Hello,
One of the most basic of Logical constructs using the IF statement in Access does not work every time.
I have a form in which there are many elements - nearly 60 or so. Of them 10 are in the nature of must be filled elements.
In my logic, for each of these fields, I have a "Lost Focus" Event. Each of the Lost Focus events call a common Public Sub in which the value of each of the fields are checked.
In the common routine, I have a "Found_Flag" dimensioned as Boolean and set to value True at the start of the call.
Next for each field, I check what the value is - if Null or Zero, then the flag is set to false.
At the end of the call, I check the value - if false, then at least one of the fields has been missed.
I find that some of the If statements do not come true which is proved by examination of values in the Immediate Window.
THis is a sample of If statements - I must be missing the wood for the forest here.. can anyone explain why this is happening.?
If (Me.Controls.Item(18).Value = Null) Then
Found_Flag = False
End If
This is from the Immediate window:
?Me.Controls.Item(18).value
Null
But Found_Flag was NOT turned to False here..
Hope someone can explain!!!
Thanks in advance
Uttam
One of the most basic of Logical constructs using the IF statement in Access does not work every time.
I have a form in which there are many elements - nearly 60 or so. Of them 10 are in the nature of must be filled elements.
In my logic, for each of these fields, I have a "Lost Focus" Event. Each of the Lost Focus events call a common Public Sub in which the value of each of the fields are checked.
In the common routine, I have a "Found_Flag" dimensioned as Boolean and set to value True at the start of the call.
Next for each field, I check what the value is - if Null or Zero, then the flag is set to false.
At the end of the call, I check the value - if false, then at least one of the fields has been missed.
I find that some of the If statements do not come true which is proved by examination of values in the Immediate Window.
THis is a sample of If statements - I must be missing the wood for the forest here.. can anyone explain why this is happening.?
If (Me.Controls.Item(18).Value = Null) Then
Found_Flag = False
End If
This is from the Immediate window:
?Me.Controls.Item(18).value
Null
But Found_Flag was NOT turned to False here..
Hope someone can explain!!!
Thanks in advance
Uttam