From: 1stAyd via AccessMonster.com on
Now I'm really confused. As an attempt to simplify, I put this line into "On
Format" of the "Detail" section:

=[Me].[Line18].[Visible]=True

but Line18 still isn't visible...... Thanks.

--
Message posted via http://www.accessmonster.com

From: Duane Hookom on
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")

--
Duane Hookom
Microsoft Access MVP


"1stAyd via AccessMonster.com" wrote:

> 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:
>
> =[Me].[Line18].[Visible]=([Me].[txtIPG]="RESALE")
>
> I'm sure the answer will be something really simple.... TIA.
>
>
> 1stAyd wrote:
> >I tried that too, but didn't realize [Inventory Posting Group] had to be tied
> >to a report control.....
>
> --
> Message posted via http://www.accessmonster.com
>
> .
>
From: 1stAyd via AccessMonster.com on
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/Forums.aspx/access-reports/201005/1

From: fredg on
On Fri, 14 May 2010 17:41:06 GMT, 1stAyd via AccessMonster.com wrote:

> Now I'm really confused. As an attempt to simplify, I put this line into "On
> Format" of the "Detail" section:
>
> =[Me].[Line18].[Visible]=True
>
> but Line18 still isn't visible...... Thanks.

Not only do you appear to be confused but now I am as well <grin>

See Duane Hookums latest reply.
I suspect, as he does, that you are placing the code in the wrong
place.
Here is how to write code.
Click on the Event Tab of the report's Detail Section property sheet.
On the Format event line write:
[Event Procedure]
Click on the little button with 3 dots that appears on that line.
The Format event code window will appear.
The cursor will be flashing between 2 already existing lines of code.
Between those 2 lines write:

Line18.Visible = [Inventory Posting Group] = "RESALE"

Exit the window and save the VBA code.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
From: Duane Hookom on
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(a)uwe> wrote in message
news:a8019d7249d18(a)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/Forums.aspx/access-reports/201005/1
>