Full Version: Print pop up option not to include one control (signature)
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
rjAccDB
Can someone please help me this report setup.

Sometimes the signature of the sender will not be printed.

I want to have a pop up dialog box (maybe radio button) to where i can select whether the signature is included in the printout..

I need badly (right now) this feature, please any help would be a life saver for me.

Many thanks,
rj
LPurvis
The signature is an image control?

Just have your popup open prior to printout - select (or not) the checkbox to Show the signature.
Don't close the popup - just hide it
Me.Visible = False

Then in your report's detail format event (I assume it's in the detail section - if not and it's the footer then the footer format event...)

Me.imgSigControl.Visible = Forms!frmPopupName!chkCheckboxControl
rjAccDB
LPurvis,

First let me correct my first post. It should be position not a signature, so it is a textbox control.

Please kind enough to guide me through.

So I will create a standard form name "frmPopupPrint" with a checkbox, are the check box bound? or unbound?

Now how can I make the pop up comes first before it opens the report.

What would be the complete code behind.

Please am under pressure so I may not describe clearly.

Many thanks for your help,
rj
rjAccDB
LPurvis,

I am using the below code to open my report, if this will help.


---
Dim strReportName As String
Dim strCriteria As String

If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "rptCorrespondence"
strCriteria = "[CorrRecID]= " & Me![CorrRecID]

DoCmd.OpenReport strReportName, acViewPreview, , strCriteria

End If
---

rj
rjAccDB
I added the below code before the DoCmd Open Report. But it gives me an error saying MS Access is not finding the frmPopUpPos form..

--
Me.Emp_Position.Visible = Forms!frmPopUpPos!PrintPos
Forms!frmPopUpPos.Visible = False
--
rjAccDB
Hi LPurvis,

I have the below code on the format event of my report'

--
DoCmd.OpenForm "frmPopUpPos"
Me.[Emp_Position].Visible = Forms![frmPopUpPos]!PrintPos
Forms![frmPopUpPos].Visible = False
--

It did hide the position control but if I open the report it goes direct in opening without give me a pause to check/uncheck my checkbox within my form "frmPopUpPos".

How can I make to let my form their until I have check/uncheck the checkbox then hide it then it open my report?

Please I need your help,
rj
Alan_G
You're almost there..........

From your form that you're currently using to open your report, instead of actually opening the report open your pop up form instead........so, step one is

If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
Docmd.OpenForm "frmPopUpName"
Me.Visible = False
End If

Then in your newly opened pop up form, you have an unbound checkbox (default value either true or false, whichever suits your needs) and an OK command button. In the on click event of your command button, put

Dim strReportName As String
Dim strCriteria As String

strReportName = "rptCorrespondence"
strCriteria = "[CorrRecID]= " & Forms!YourMainFormName!CorrRecID

Me.Visible = False

DoCmd.OpenReport strReportName, acViewPreview, , strCriteria

Now in the Format event of your report

Me.[Emp_Position].Visible = Forms!frmPopUpName!PrintPos

Don't forget to close your still open (hidden) forms in the On Close event of your report

Docmd.Close acForm, "frmPopUpName"
Docmd.Close acForm, "YourMainFormName"

Good luck..............
rjAccDB
Hi Alan,

Let me try it.. Anyhow I have made in the format event of my report and set my popup form a popup in the property sheet, so it is there always on the screen..

Many thanks Alan,
rj
LPurvis
Right.

Hi again (been out... which is unusual for me on a Sunday instead of just working :-S)

Where are you at now.
You have the control hiding - but not the option of your Popup.
You need to open the popup form in dialog mode to hault execution of further code until that form is dismissed (being dismissed is either by being closed or hidden - thankfully).

In the button you open you report from have
DoCmd.OpenForm "frmPopUpPos", WindowMode:=acDialog
Docmd.OpenReport "YourReport"

Then in your reports relevant section format event just
Me.[Emp_Position].Visible = Forms![frmPopUpPos]!PrintPos
LPurvis
(And I had something to eat before sending that last post - hence not having seen Alan's chipping in. :-)
rjAccDB
Alan / LPurvis,

Thank you for your responses.. I have tried the solution of Alan but it gives me an error saying that the form metioned can not be found. probably because it is hiden after opening..

Anyway I have to get some quick bite and try later..

Again many thanks, both of you are so kind,,

rj
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.