A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Set Visible On Button Click



 
 
Thread Tools Display Modes
  #1  
Old July 18th, 2007, 10:02 PM posted to microsoft.public.access.reports
dsc2bjn
external usenet poster
 
Posts: 94
Default 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  
Old July 18th, 2007, 10:45 PM posted to microsoft.public.access.reports
Carl Rapson
external usenet poster
 
Posts: 517
Default 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  
Old July 19th, 2007, 12:44 AM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default 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  
Old July 19th, 2007, 04:08 PM posted to microsoft.public.access.reports
dsc2bjn
external usenet poster
 
Posts: 94
Default 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  
Old July 19th, 2007, 05:10 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default 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  
Old July 19th, 2007, 05:58 PM posted to microsoft.public.access.reports
dsc2bjn
external usenet poster
 
Posts: 94
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.