PC Review


Reply
Thread Tools Rate Thread

Re: Conditionally Format A Line?

 
 
fredg
Guest
Posts: n/a
 
      14th May 2010
On Thu, 13 May 2010 20:28:14 GMT, 1stAyd wrote:

> Greetings, Access Novice here.
>
> I have Line18 formatted as Visible = "NO" in Properties, and I want to make
> it visible depending on the value of certain fields. Why doesn't this code
> work when put in the "On Format" or "On Print" events of the Detail section?
>
> If [Inventory Posting Group] = "RESALE" Then Line18.Visible = "YES"
>
> BTW, I tried "TRUE" in place of "YES", and it still didn't work. TIA.


You've turned the Yes (no quotes) into "Yes" (a string value).
Anyway in VBA it should have been True (without the quotes) not Yes.
Yes is not a VBA constant. True is.

If [Inventory Posting Group] = "RESALE" Then Line18.Visible = True

A simpler expression would be:
Line18.Visible = [Inventory Posting Group] = "RESALE"

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
Reply With Quote
 
 
 
 
fredg
Guest
Posts: n/a
 
      14th May 2010
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditionally format anumber format Montana Microsoft Excel Worksheet Functions 5 15th Jan 2008 06:25 PM
Conditionally format another cell? Robin Microsoft Excel Discussion 1 28th Nov 2004 12:55 PM
Re: Can I conditionally format table cells in Word, like I can in Exc. Cindy M -WordMVP- Microsoft Word Document Management 0 28th Sep 2004 02:48 PM
Re: Can I conditionally format table cells in Word, like I can in Exc. Word Heretic Microsoft Word Document Management 0 25th Sep 2004 02:59 AM
Can I conditionally format table cells in Word, like I can in Exc. =?Utf-8?B?UE1PNGxpZmU=?= Microsoft Word Document Management 0 21st Sep 2004 08:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:38 PM.