Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Access Report - Make label invisible (if ..)

Posted on 2014-04-09
6
1,290 Views
Last Modified: 2014-04-12
Hi,

I have a database than monitors the fixing of cars.

I have a "job" form that has an BUTTON to print a single page "jobsheet".

The "CallOutCharge" prints on the jobsheet (using qryJobSheet)

However, if the "CallOutCharge" is zero then the report label called "label999" should NOT print (or be invisible).

How do I make "label999" NOT print.
0
Comment
Question by:Patrick O'Dea
  • 3
  • 3
6 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 39990177
Add VBA to the Format event of the detail section (or whatever section the label is in):


Me.Label999.visible = (Me.CallOutCharge <> 0)

Open in new window

0
 
LVL 61

Expert Comment

by:mbizup
ID: 39990184
Alternatively, use a textbox for this instead of a label and use conditional formatting.

Select Expression Is from the drop-down and place this in the expression entry box:

[CallOutCharge] = 0

Open in new window


and set the text and background formatting to make the textbox blend in with the paper (eg: all white)
0
 

Author Comment

by:Patrick O'Dea
ID: 39990256
Thanks mbizup,

Option A worked well.

I note that when I change to "CallOutCharge" on the main form - The report prints the ORIGINAL (unchanged) value.

However, If I exit the form and re-enter and THEN print - All is well!

Why?
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:Patrick O'Dea
ID: 39990260
Sorry mbizup,

I had intended to put my last response (above) as a separate question.

Would this be a better way to go?
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39990370
No worries...

The reason that is happening is most likely that the data on your form has not been committed to the table yet, and (drum roll...) the report is reading data from the table not directly off the form.

To ensure that you have the updated data displaying in your report, force a save immediately before your OpenReport statement, like this:

Me.Refresh  ' Or docmd.runcommand accmdSaveRec
Docmd.OpenReport ... etc..

Open in new window

.

Take a look at this article, for this and similar issues:
http://www.experts-exchange.com/Database/MS_Access/A_10162-What-is-in-a-field-Value-vs-Text-and-the-differences-between-form-data-and-table-data.html
0
 

Author Closing Comment

by:Patrick O'Dea
ID: 39996626
Great, that's fixed it!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question