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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report formatting with code 2

Status
Not open for further replies.

xezekielx

IS-IT--Management
Jun 30, 2005
93
CA
Hi! I'm trying to format some text fields of my report through the code but it doesn't work. I want the text to be bold if a boolean field is true and regular if the boolean field is false. Here's what I tried :
Code:
txtField1.FontBold = cBool(Me!blnField1)

When I open the report, I get an error message saying that the field blnField1 can't be found... I checked the report's data source and everything's OK. I even put the boolean field ON the report itself, making it a checkbox but it still won't work. Any idea what I might be doing wrong?

Thanks in advance!
 
There is a report forum here, forum703, where report qestions perhaps fits a bit better...

For this question, I don't think the control values are available in the on open event of reports (assuming you mean a control, even if you refer to field), but for instance in the on format event of the section where they reside.

Roy-Vidar
 
You may try the Format event procedure of the section where is txtField1.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks guys, I was writing the code in the OnOpen event instead of the OnFormat event... it works now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top