If Then Else the moment a txtbox is entered

kupe

Registered User.
Local time
Today, 09:51
Joined
Jan 16, 2003
Messages
462
In If...Then...Else on a textbox, can I state something like "if anything at all is entered here", please? Or can I say apply this ForeColor upon enter with IF...Then...Else?

I thought an If Then Else because I want the normal controls to apply for the following record(s).
 
If anything is entered in a textbox then you can use the IsNull() function. If it's True then the textbox is empty; if it's false then the textbox has something entered into it.

ie..

Code:
If IsNull(Me.MyTextBox) = True Then
    MsgBox "Empty"
Else
    MsgBox "Has Text"
End If
 
I was thinking of returning to 'normal' with Lost Focus, but yours has to be the way. Many thanks, MoP. Cheers
 

Users who are viewing this thread

Back
Top Bottom