I utlized the example code (see below)and it works great.
One problem though, how would you make the colored field "grow" as necessary with the rest of the information in each record. For example, I have fields with one line of comments and some that take a quarter of the page on the report. How can I make the ext_Site field grow with that, or any other, field. Currently it just remains the same size all the time since it has no information in it to necessitate "growing". Thank you for your help
Jim
posted 09-26-2001 02:50 PM
I did something similar to this in a database I have...
Here is the code with an explanation following:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Select Case Security_Status ' Evaluate the Security_Status field
Case "Priority 1" ' Priority 1 locations
Me!ext_Site.BackColor = 12632256 ' Leave the shading White
Case "Priority 2" ' Priority 2 locations
Me!ext_Site.BackColor = 16777215 ' Change the shading to Grey
End Select
End Sub
You have to run this in the detail so it executes for every record on the report.
Basically whay MINE does, is...
As each record is dropped onto the report, access checks the Security_Status and if the field contains the text "Priority 1" or "Priority 2" it shades the Site number. on the report. Now I had to set the ext_Site field on the report to BackStyle = Normal, but I did that through the properties of the field in the reports Design view. Having it as Transparent will mean you don't see any shading. So make sure you set that right.
Hopefully, this helps. Any questions, just let me know.
One problem though, how would you make the colored field "grow" as necessary with the rest of the information in each record. For example, I have fields with one line of comments and some that take a quarter of the page on the report. How can I make the ext_Site field grow with that, or any other, field. Currently it just remains the same size all the time since it has no information in it to necessitate "growing". Thank you for your help
Jim
posted 09-26-2001 02:50 PM
I did something similar to this in a database I have...
Here is the code with an explanation following:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Select Case Security_Status ' Evaluate the Security_Status field
Case "Priority 1" ' Priority 1 locations
Me!ext_Site.BackColor = 12632256 ' Leave the shading White
Case "Priority 2" ' Priority 2 locations
Me!ext_Site.BackColor = 16777215 ' Change the shading to Grey
End Select
End Sub
You have to run this in the detail so it executes for every record on the report.
Basically whay MINE does, is...
As each record is dropped onto the report, access checks the Security_Status and if the field contains the text "Priority 1" or "Priority 2" it shades the Site number. on the report. Now I had to set the ext_Site field on the report to BackStyle = Normal, but I did that through the properties of the field in the reports Design view. Having it as Transparent will mean you don't see any shading. So make sure you set that right.
Hopefully, this helps. Any questions, just let me know.