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

Chang report field prop using module

Status
Not open for further replies.

sroche

IS-IT--Management
Jul 6, 2001
4
US
I am looking to use a module to change the field properties of a report to show bold if certain criteria is met. Any help will be appreciated.
 
In the Details OnFormat Event, put the following code (change to your criteria and field names appropriately):

=========
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.Text1 > 120 Then
Me.Text1.FontBold = True
Else
Me.Text1.FontBold = False
End If
End Sub Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
Or better yet, use boolean logic:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.Text1.FontBold = Me.Text2 > 100
End Sub Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
I have a report that needs more columns in the first six pages and for the first six pages to be printed in landscape. The rest of the report is printed in potrait format with a lesser number of columns. Is there any way to automate this process with code so
 

I am having the same problem except instead of bolding the data, I need to change the back color based on the criteria. Basically, if cost2 field is greater than cost1 field, display the data with green back color. Otherwise, display data with white back color. In the control source property, I click on the Expression Builder to write my IIF statement.

IIf([cost1] > [cost2], [cost] AND [cost].backcolor = 108854, [cost] AND [cost].backcolor = 567893)

I think my code and syntax are probably not correct, so can you help me with this problem.

Thank you so much
Di
 
errolf,

Sorry, but I do not know how to do what you are requesting.

Di,

You would not do the comparison in your query, you would do it on the Format event of the detail section of your report:

Private Sub Detail_Format()
If Me.Cost1 > Me.Cost2 Then
Me.Cost.BackColor = 108854
Else
Me.Cost.BackColor = 567893
End If
End Sub

This is of course assuming you have 3 fields (cost, cost1 & cost2).
Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
I don't put my code in the query, I put them in the detail property control source box in the Report Design View. Isn't there a way that I can manipulate the property value with an absolute code.

Thank you!
Di
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top