Gasman
Enthusiastic Amateur
- Local time
- Today, 00:21
- Joined
- Sep 21, 2011
- Messages
- 16,741
A user on another forum had code similar to the code below.
I created mine to test my theory was correct even with an evident Compile error message of 'Method or data member not found'
The error occurs on the SetFocus line.
My question is why did the compiler not pick it up on the IsNull line?
I must admit, I mostly always used the dot when I coded, unless it was for something like Forms! etc, however it seems a little flaky if you use the bang as above and the compiler does not flag it.?
Please do not ask me why he used one method and then the other, I would have no clue.
I created mine to test my theory was correct even with an evident Compile error message of 'Method or data member not found'
Code:
Private Sub Command15_Click()
If IsNull(Me!txtResult1) Then
MsgBox "Test is null"
Me.txtResult1.SetFocus
End If
End Sub
The error occurs on the SetFocus line.
My question is why did the compiler not pick it up on the IsNull line?
I must admit, I mostly always used the dot when I coded, unless it was for something like Forms! etc, however it seems a little flaky if you use the bang as above and the compiler does not flag it.?
Please do not ask me why he used one method and then the other, I would have no clue.
