View Single Post
  #10  
Old May 15th, 2010, 06:11 AM posted to microsoft.public.access.reports
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default Conditionally Format A Line?

Have you allow the application to run code? Are you viewing the report in
Print Preview?
The code should look something like this:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.[Line18].Visible = (Me.[txtIPG] = "RESALE")
End Sub
To see if this code is causing the issue, try comment out the line of code
like:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
' Me.[Line18].Visible = (Me.[txtIPG] = "RESALE")
End Sub

--
Duane Hookom
MS Access MVP



"1stAyd via AccessMonster.com" u60050@uwe wrote in message
news:a8019d7249d18@uwe...
Thanks, Duane, but I'll still SOL. In "On Format" of Detail it now says
"Event Procedure", and I copied exactly what you have into the code
window.
The code window now says:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.[Line18].[Visible] = (Me.[txtIPG] = "RESALE")
End Sub

I tried to print instead of previewing, and I got this message: "A custom
macro in this report has failed to run, and is preventing the report from
rendering". In case it makes a difference, I'm using Access 2007.
Thanks.


Duane Hookom wrote:
You must be in the code/module/vba window, not in the properties dialog.
There should not be any "=", just:
Me.[Line18].[Visible]=([Me].[txtIPG]="RESALE")

Still no luck. I created txtIPG, with the control source as [Inventory
Posting Group], and have this in the "On Format" event of the detail
section:

[quoted text clipped - 5 lines]
I tried that too, but didn't realize [Inventory Posting Group] had to
be tied
to a report control.....


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ports/201005/1