View Single Post
  #4  
Old May 14th, 2010, 06:49 AM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Conditionally Format A Line?

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