Hey buddies i create a form and a report i am using signature image on report through form i made a checkbox ... now anyone tell me please how to VBA code to hide or unhide the signature image in report ............. not in form......
Hide / Unhide Picturebox or TextBox in MS Access Report Using Checkbox??
Collapse
X
-
This would require you to somehow send the state of the checkbox to the report. If your desire is to display/not display the signature image on a "per record" basis, then it might be easiest to have a yes/no field in one of your underlying tables. As you set the checkbox to either True or False (checked or unchecked) via your form, when you display the report, you would have to modify the OnFormat property of the section of the Report in which you have your signature image. Then, it is as simple as inserting this code:
Of course, you need to modify that to reflect your actual Control and Field names.Code:Me.ImageControlName.Visible = Me.CheckBoxFieldName
Hope this hepps! -
- You can use the OpenArgs Argument of the OpenReport Method to accomplish this.
- Let's assume the following scenario:
- Report Name = Invoices
- The Check Box on the Current Form is named chkSignature
- You have an Image Control on the Invoices Report named imgSignature.
- You can now use the OpenArgs Argument of the OpenReport Method to transfer the State of chkSignature on your Form to the Invoices Report. The State of the Check Box can either be NULL, Checked, Un-checked.
- In the Click() Event of a Command Button I now Open the Report passing the State of chkSignature to it.
Code:Private Sub cmdOpenReport_Click() DoCmd.OpenReport "Invoices", acViewPreview, , , acWindowNormal, IIf(IsNull(Me![chkShowSignature]), 0, Me![chkShowSignature].Value) End Sub
- In the Open() Event of the Report, I can now determine whether or not to display the Image Control (imgSignature).
Code:Private Sub Report_Open(Cancel As Integer) Me![imgSignature].Visible = Me.OpenArgs End Sub
- The Code has been tested and is fully functional.
Comment
-

as in image i made a checkbox on the report above the sign if i preview the certificate in report view then i check the checkbox the sign appear. in another image i made the checkbox on form above the sign if i check the checkbox then the sign appear on form.
i code like this
if check37 = click then
me.Sign.visible = true
else
me.sign.visible = false
same i code in report on another checkbox
the problem is that i want to appear and disappear the sign on report not on form. i want to check / uncheck the checkbox on form and the sign appear and disappear on report.
so i tried to code the form checkbox in vba like this
Report![CertificatePrin t].Sign.visible = true
else
Report![CertificatePrin t].Sign.visible = false
but this code is not working ...Comment
-
Both I and ADezii have given you viable options for solving this issue. It may be wise for you to pursue those avenues first, rather than inventing alternate options which ignore this advice and try to overcomplexify things.
Both proposed solutions are rather simple, straightforward , tested, tried and true. I’d be glad to help you troubleshoot one of those options with you. So would ADezii, I am sure—or any of the other experts on this forum.Comment
-
It appears that we need to go to 'Plan B' at this time. You have two viable Options here, one from twinnyfo, and the other from myself, both of which you apparently not considered. I am attaching a Demo for you which should clearly illustrate how this can be done. Select/De-select the Check Box on the Form, then click the Command Button to Open the Invoices Report. The Demo is self explanatory.
[imgnothumb]https://bytes.com/attachments/attachment/10315d159714570 9/demo.jpg[/imgnothumb]Comment
Comment