Solved

Access Report - Make label invisible (if ..)

Posted on 2014-04-09
6
1,314 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
[X]
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
  • 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

728 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