473,512 Members | 15,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hide / Unhide Picturebox or TextBox in MS Access Report Using Checkbox??

58 New Member
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......
Aug 10 '20 #1
8 3139
twinnyfo
3,653 Recognized Expert Moderator Specialist
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:
Expand|Select|Wrap|Line Numbers
  1. Me.ImageControlName.Visible = Me.CheckBoxFieldName
Of course, you need to modify that to reflect your actual Control and Field names.

Hope this hepps!
Aug 10 '20 #2
NeoPa
32,557 Recognized Expert Moderator MVP
Your question makes no real sense. There is so much you need to explain, just to make the question make sense, and you just haven't.
Aug 10 '20 #3
ADezii
8,834 Recognized Expert Expert
  1. You can use the OpenArgs Argument of the OpenReport Method to accomplish this.
  2. Let's assume the following scenario:
    1. Report Name = Invoices
    2. The Check Box on the Current Form is named chkSignature
    3. You have an Image Control on the Invoices Report named imgSignature.
  3. 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.
  4. In the Click() Event of a Command Button I now Open the Report passing the State of chkSignature to it.
    Expand|Select|Wrap|Line Numbers
    1. Private Sub cmdOpenReport_Click()
    2. DoCmd.OpenReport "Invoices", acViewPreview, , , acWindowNormal, IIf(IsNull(Me![chkShowSignature]), 0, Me![chkShowSignature].Value)
    3. End Sub
  5. In the Open() Event of the Report, I can now determine whether or not to display the Image Control (imgSignature).
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Report_Open(Cancel As Integer)
    2.   Me![imgSignature].Visible = Me.OpenArgs
    3. End Sub
  6. The Code has been tested and is fully functional.
Aug 10 '20 #4
ZKAHADI
58 New Member



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![CertificatePrint].Sign.visible = true
else
Report![CertificatePrint].Sign.visible = false

but this code is not working ...
Aug 11 '20 #5
twinnyfo
3,653 Recognized Expert Moderator Specialist
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.
Aug 11 '20 #6
ADezii
8,834 Recognized Expert Expert
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.

Attached Images
File Type: jpg Demo.JPG (49.5 KB, 587 views)
Attached Files
File Type: zip Show Image On Report.zip (35.9 KB, 45 views)
Aug 11 '20 #7
ZKAHADI
58 New Member
thank you very much you solved my problem ADezii
Aug 12 '20 #8
ADezii
8,834 Recognized Expert Expert
You are very welcome, good luck with your Project.
Aug 12 '20 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2933
by: Joris Kempen | last post by:
Hi people, I know that the question has come around sometimes: How to open an Access Report using ASP and export it to for example RTF. I'm trying to implement the first method of David...
2
8106
by: Vikrant | last post by:
Hey Friends I need to export an Access Report using a filter. I am using the method OutputTo m_pDoCmd->OutputTo( 3, // asOutputReport COleVariant(strReportName), // <report name>...
1
3002
by: mar10a | last post by:
I am trying to insert a .gif. file into an Access report - using Insert Picture. The original image is 8X11, but access changes the size to 4X6.5. When I change the size of the image in access...
2
3578
by: kmacon | last post by:
I am looking for a grid control that I can use in an Access report. I have seen Stephan Lebans solution for PrintLines, MS's Dynamic Crosstab query, and several others. However, none of them work...
6
2368
by: Bluecove | last post by:
I have a report to create a catalog of books from an Access table - it works great. Sometimes I need to print out ONLY the record that is currently shown in a form (for example, to place it with a...
4
3325
by: somanyusernamesaretakenal | last post by:
What I am trying to achieve: Basically I have generated a report in access. This report needs to be updated using excel. (Updating the new data, not changing existing data) What I did was I...
0
1089
by: BillHounslow | last post by:
hope someone can help me. Currently, I am printing four, multi-page Access 2003 Reports to MS Document Imaging, then manually combining them to form a single document for distribution. Can...
14
5143
by: wassimdaccache | last post by:
Hello everybody :) is there any function in Visual basic that I can use it to have a message box for my form for a certain second and after it will hide automatically for example : ...
4
4966
by: crissorion | last post by:
I have an array of some data that i get from object, I can't get same data from query to database, so I can't just paste recordsourse to sql query. How can I populate the report? Now I get all the...
2
3100
by: iamvova | last post by:
Could anybody explain how I can find control (for example calendar or textbox) in GridView row? Then I need to hide it. I have edit row number. var grid = document.getElementById('<%=...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5676
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.