Yes, that means you still have it messed up ;-)
You can easily get to the Format event procedure
(automatically creating the Dub/End Sub statements if
needed), by first clicking in any blank area or the little
separator bar of the detail section, then viewing the
section's property sheet. Once you can see the property
sheet titled Section: Detail, select the Event tab and then
clicking on the little [...] button in the right margin of
the OnFormat property.
That should take you to the report's code module with the
cursor in the right place to put your code between the
Private Sub Detail_Format( . . .
and the
End Sub
lines.
Double check the OnFormat property to make sure it contains
[Event Procedure]
After all the fooling around you've done, it would be a good
idea to view the entire module and make sure you haven't
left any junk laying around. After you think it's ready to
go, use the menu item Debug - Compile <your project> to
check for syntax errors, misspelled names and other errors.
Only after the compile completes without complaint, should
you attempt to open the report to see what happens.
--
Marsh
MVP [MS Access]
Chief said:
I changed the dropdown menu from (General) to "Detail" and I when I
attempted to open the report I recieved the following msg: "The expression On
Format you entered as teh event property setting produced teh follwoing
error: Invalid Outside Procedure.
Does this mean anything to you?
Chief THK wrote:
I've been fighting with this code for a while and still have not got it to
work
I double checked the field names and they are correct. I thought that maybe
that "Album" should be bracked by [] so I tried that also.
Let me make sure that I'm in the correct format/window.
I start by opening the report, then I select the "Design View" option, then I
select the "Code" button. Then I paste the syntax that you stated
(see below). I placed that in the "(General)" and "(Declarations)" page
of MicroSoft Visual Basic.
I'm sure that I've made this more difficult than
necessary but it seems to be kicking my butt.
All I want to do is turn the darn letters red for that particular record
Option Compare Database
If Me.[iTunes Selection?] = No Then
Me.[Album].BackColor = 255 'Red
Me.[Year].BackColor = 255
Me.[Format].BackColor = 255
Else
Me.[Album].BackColor = 16777215 'White
Me.[Year].BackColor = 16777215
Me.[Format].BackColor = 16777215
End If
Marshall Barton said:
The Declarations area of a module is for declaring module
level variables, not for executable statements.
The code needs to go in the Format event procedure of the
section containing the text box's you're trying to
manipulate, probaly the Detail section.