Conditional formatting help (vba) (1 Viewer)

ToucHDowN

Registered User.
Local time
Yesterday, 18:36
Joined
May 4, 2014
Messages
36
Hi,

I have a textbox (say tbo1) in a form and what I want to do is this:

If tableA.fieldA IsNot Null Then
Make tbo1 background fill=Red

and

OnClick open Form2

What's the proper syntax in VBA?

Thanks in advance!
 

ToucHDowN

Registered User.
Local time
Yesterday, 18:36
Joined
May 4, 2014
Messages
36
Hi,

I have a textbox (say tbo1) in a form and what I want to do is this:

If tableA.fieldA IsNot Null Then
Make tbo1 background fill=Red

and

OnClick open Form2

What's the proper syntax in VBA?

Thanks in advance!

Never mind, I did it.

On Form Load, I set these parameters:

If Not IsNull(fieldA) Then
Me.tbo1.BackColor = vbYellow
End If

Then, in the tbo1 textbox I set the following OnClickevent:

If Not IsNull(fieldA) And Me.tbo1 = "xxxxx" Then
DoCmd.OpenForm "Form2"
End If
 

pr2-eugin

Super Moderator
Local time
Today, 02:36
Joined
Nov 30, 2011
Messages
8,494
Very glad you found your own answer. However a small suggestion, it would be more appropriate if you would move from Form Load to Form Current.
 

Users who are viewing this thread

Top Bottom