Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide an ole object field based off of the value of another field

Status
Not open for further replies.

bddewell408

Technical User
Jul 25, 2003
56
US
I am using Access 2007.

To make a long story short, I have developed a database for my father, a mechanical engineer, and have duplicated a CERTIFICATION FORM for pressure vessels he inspects.

I developed this with the intention of allowing other inspectors to get a copy and use it themselves, so I created a table named tblInspector and in that table I have a field named oleSignature, this is a field that allows the inspector to scan his signature and insert it, so when a PDF is created of the form, the signature and certifying mark are on the page and the form does not need to be scanned as a picture file to send it electronically.

I do not want the signature or marks showing until after the inspector has checked a checkbox named ysninsertSig.


THE PROBLEM

In the ON OPEN I have attempted to use a macro that says :

Condition Reports![rptInspectionReportbyReportNumber]![ysnInsertSig]=True (or -1, neither work)

Action Set Property oleSignature Visible -1

I get a TypeMismatch error

This same strategy works for hiding controls and subforms in the forms, why does this not work on the reports.
 
I think the On Open event of the report might be too early to run the code/macro. I would try calling the code/macro in the On Format event of the section containing the oleSignature.

Duane MS Access MVP
 
I tried the OnFormat and that did not work, I am at a loss. In case anyone has some time here are the exact field names, report name, etc

Expr1 (this is the field in the macro that returns "True" or "False" depending on whether a check box has been checked or not

oleSignature - this is the ole object I want hidden if Expr1 is False, visible if true

oleMarks - another ole object I want hidden based on results from Expr1

rptInspectionReportbyReportNumber - report name


Thx in advance
 
I really don't work with macros at all. Your where condition in the macro uses [ysnInsertSig] yet you state the Expr1 is used in the macro.

I would add code to the On Format event code of the section of the report containing the controls you want to hide. The code might look like
Code:
Me.oleSignature.Visible = Me.chkBoxInReportSection
Replace chkBoxInReportSection with the name of your bound control that has a control source of your yn field.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top