How to Make the particular text field BOLD based on the Value from query (1 Viewer)

balaryan

Registered User.
Local time
Today, 17:11
Joined
Jul 1, 2015
Messages
12
Hi All,

Good day. I am using MS Access 2007 and have a report which display the list of values (say 10 fields) from the basic SELECT * FROM table query.

I need to dynamically set the BOLD based on the particular value for the fifth field which was assigned from Query. if it doesn't match it should display normal.

E.g
If Field_5 = "Agent" then
Field_5.FontBold = True
Else
Field_5.FontBold = False
End if

I tried the aforementioned code and it dont work. ALso i tried achieve it using below listed options.

Me.Field_5.FontBold = True
Field_5.Properties("fontweight") = 700

But nothing worked. Kindly assist me.
 

Minty

AWF VIP
Local time
Today, 12:41
Joined
Jul 26, 2013
Messages
10,382
I think you need the me qualifier ;
Code:
If Field_5 = "Agent" then
[COLOR="red"]Me.[/COLOR]Field_5.FontBold = True
Else
[COLOR="Red"]Me.[/COLOR]Field_5.FontBold = False
End if
 

balaryan

Registered User.
Local time
Today, 17:11
Joined
Jul 1, 2015
Messages
12
Thanks Gasman. Your information saved me in right time. it works. :)

Thanks a ton my friend. :D:eek:
 
Last edited:

CJ_London

Super Moderator
Staff member
Local time
Today, 12:41
Joined
Feb 19, 2013
Messages
16,728
you can also use conditional formatting
 

Users who are viewing this thread

Top Bottom