Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically bolding control(s) on a report 2

Status
Not open for further replies.

BSman

Programmer
Apr 16, 2002
718
US
I've set up a report that I will use to produce three different variations. When producing the report, I would like to bold one of the controls based on which of the three versions was selected to be run.

I tried the following code in the form's on open property and then in the details area (on format), but neither actually changed the font weight of the control to bold.

me.MySelectedControl.FontWeight = Bold

Although "FontWeight" wasn't listed in the drop down list of properties in the VBA code, when I typed it in using all lowercase, VBA changed it to the way it's displayed above, suggesting that it's a valid property to affect.

Bob
 
What are you trying to change? Are you trying to make the control's label bold? If so, you should remember to use a reference to the label, not to the control itself. The VBE automatically upper cased the property because it is a valid method for some controls, but does not do anything for some.


-V
 
It's a text box, not a label, that I want to bold. I want to emphasize the data in the column that is related to the version of the report being produced.

Bob
 
Thanks V, it worked. And where can a list be found of those properties (that don't show in the drop down list when writing the VBA code)?

Bob
 
I just made a dummy text box on a form an referenced it in the VBE. Since the VBE knew it was referencing a textbox and not just any control, it displayed the full drop down.


-V
 
What version of Access are you working in? This application is in 2000 (I also have 2003, but need 2000 for this because some of the users don't have 2003), and referencing a text box in VBA doesn't show the FontBold, FontWeight, and similar properties. Hopefully, things have improved in 2003 and 2007.

Bob
 
Just a note for anyone reading this. In both Access 2000 and 2003, when you are in a report (which is where I was), in order to access the properties like FontBold, FontWeight, etc., when you reference a text box in VBA, you first select the property "Report", and then you will get the properties of FontBold, FontWeight, etc. When in a form FontBold, FontWeight, etc., are listed immediately, rather than on the next level.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top