If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Set Visible On Button Click
I have a very demanding client that I am trying to satisfy.
They would like to make a control in a report visible only when the user uses a "Print" button and not when they use a "Preview" button. Setting the control invisible is a no brainer, but how can I make the control visible when the user clicks on the "Print" button. Any suggestions would be greatly appreciated (changing clients isn't an option at this time). |
#2
|
|||
|
|||
Set Visible On Button Click
"dsc2bjn" wrote in message
... I have a very demanding client that I am trying to satisfy. They would like to make a control in a report visible only when the user uses a "Print" button and not when they use a "Preview" button. Setting the control invisible is a no brainer, but how can I make the control visible when the user clicks on the "Print" button. Any suggestions would be greatly appreciated (changing clients isn't an option at this time). From what I can tell, the report's Activate event only fires when the report is previewed, not printed. So maybe you could make the control invisible by default and in the Activate event you could make the control visible. Carl Rapson |
#3
|
|||
|
|||
Set Visible On Button Click
On Wed, 18 Jul 2007 14:02:01 -0700, dsc2bjn wrote:
I have a very demanding client that I am trying to satisfy. They would like to make a control in a report visible only when the user uses a "Print" button and not when they use a "Preview" button. Setting the control invisible is a no brainer, but how can I make the control visible when the user clicks on the "Print" button. Any suggestions would be greatly appreciated (changing clients isn't an option at this time). The actual starting value of intPreview depends upon if you have a control in the report to compute [Pages], i.e. ="Page " & [Page] & " of " & [Pages] Option Compare Database Option Explicit Dim intPreview As Integer Private Sub Report_Activate() intPreview = -1 ' Pages Not used ' intPreview = -2 ' Pages used End Sub =============== Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) ' If intPreview = 1 Then ' Pages used If intPreview -1 Then ' Pages is not used Me![Data].Visible = True Else Me![Data].Visible = False End If intPreview = intPreview + 1 End Sub -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#4
|
|||
|
|||
Set Visible On Button Click
I do have the Page of Pages control on the report.
I used your code, but it didn't work. I set the [Reporting Period] control to invisible and it stays invisible both in preview and when printing. I should point out that the "Print" button is running a macro that sends the report via email as a snapshot file. The user isn't actually printing a hard copy report. "fredg" wrote: On Wed, 18 Jul 2007 14:02:01 -0700, dsc2bjn wrote: I have a very demanding client that I am trying to satisfy. They would like to make a control in a report visible only when the user uses a "Print" button and not when they use a "Preview" button. Setting the control invisible is a no brainer, but how can I make the control visible when the user clicks on the "Print" button. Any suggestions would be greatly appreciated (changing clients isn't an option at this time). The actual starting value of intPreview depends upon if you have a control in the report to compute [Pages], i.e. ="Page " & [Page] & " of " & [Pages] Option Compare Database Option Explicit Dim intPreview As Integer Private Sub Report_Activate() intPreview = -1 ' Pages Not used ' intPreview = -2 ' Pages used End Sub =============== Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) ' If intPreview = 1 Then ' Pages used If intPreview -1 Then ' Pages is not used Me![Data].Visible = True Else Me![Data].Visible = False End If intPreview = intPreview + 1 End Sub -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#5
|
|||
|
|||
Set Visible On Button Click
On Thu, 19 Jul 2007 08:08:06 -0700, dsc2bjn wrote:
I do have the Page of Pages control on the report. I used your code, but it didn't work. I set the [Reporting Period] control to invisible and it stays invisible both in preview and when printing. I should point out that the "Print" button is running a macro that sends the report via email as a snapshot file. The user isn't actually printing a hard copy report. "fredg" wrote: On Wed, 18 Jul 2007 14:02:01 -0700, dsc2bjn wrote: I have a very demanding client that I am trying to satisfy. They would like to make a control in a report visible only when the user uses a "Print" button and not when they use a "Preview" button. Setting the control invisible is a no brainer, but how can I make the control visible when the user clicks on the "Print" button. Any suggestions would be greatly appreciated (changing clients isn't an option at this time). The actual starting value of intPreview depends upon if you have a control in the report to compute [Pages], i.e. ="Page " & [Page] & " of " & [Pages] Option Compare Database Option Explicit Dim intPreview As Integer Private Sub Report_Activate() intPreview = -1 ' Pages Not used ' intPreview = -2 ' Pages used End Sub =============== Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) ' If intPreview = 1 Then ' Pages used If intPreview -1 Then ' Pages is not used Me![Data].Visible = True Else Me![Data].Visible = False End If intPreview = intPreview + 1 End Sub -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Then it's not actually BEING printed is it? -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#6
|
|||
|
|||
Set Visible On Button Click
No. The idea is to reduce paper copies, so no actual printing occurs.
The user can print the report through the "Preview" button, but I do not want it to show the [Reporting Period] value. The data is collected put into the report format and send as a snapshot view Via email. When they "Print" (now is renamed as "Submit"), I prompt them to enter value for the [Reporting Period]. I want the control to be visible when they send the report Via email. "fredg" wrote: On Thu, 19 Jul 2007 08:08:06 -0700, dsc2bjn wrote: I do have the Page of Pages control on the report. I used your code, but it didn't work. I set the [Reporting Period] control to invisible and it stays invisible both in preview and when printing. I should point out that the "Print" button is running a macro that sends the report via email as a snapshot file. The user isn't actually printing a hard copy report. "fredg" wrote: On Wed, 18 Jul 2007 14:02:01 -0700, dsc2bjn wrote: I have a very demanding client that I am trying to satisfy. They would like to make a control in a report visible only when the user uses a "Print" button and not when they use a "Preview" button. Setting the control invisible is a no brainer, but how can I make the control visible when the user clicks on the "Print" button. Any suggestions would be greatly appreciated (changing clients isn't an option at this time). The actual starting value of intPreview depends upon if you have a control in the report to compute [Pages], i.e. ="Page " & [Page] & " of " & [Pages] Option Compare Database Option Explicit Dim intPreview As Integer Private Sub Report_Activate() intPreview = -1 ' Pages Not used ' intPreview = -2 ' Pages used End Sub =============== Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) ' If intPreview = 1 Then ' Pages used If intPreview -1 Then ' Pages is not used Me![Data].Visible = True Else Me![Data].Visible = False End If intPreview = intPreview + 1 End Sub -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Then it's not actually BEING printed is it? -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
Thread Tools | |
Display Modes | |
|
|