Printing

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

Hello,

I have the following code on a forms On Current property:

Private Sub Form_Current()
If [STATUS] = "Bronze" Then Me.Bronze.Visible = True Else Me.Bronze.Visible
= False
If [STATUS] = "Silver" Then Me.Silver.Visible = True Else Me.Silver.Visible
= False
If [STATUS] = "Gold" Then Me.Gold.Visible = True Else Me.Gold.Visible = False
End Sub

This shows the relevany bitmap based on the field called Status. So if
Status says gold then the Gold symbol is shown. This works fine but when the
user views on print preview or actually prints the form then the code no
longer works.

Can anyone help with this?

Many thanks in advance.

Martin
 
Martin said:
Hello,

I have the following code on a forms On Current property:

Private Sub Form_Current()
If [STATUS] = "Bronze" Then Me.Bronze.Visible = True Else
Me.Bronze.Visible
= False
If [STATUS] = "Silver" Then Me.Silver.Visible = True Else
Me.Silver.Visible
= False
If [STATUS] = "Gold" Then Me.Gold.Visible = True Else Me.Gold.Visible =
False
End Sub

This shows the relevany bitmap based on the field called Status. So if
Status says gold then the Gold symbol is shown. This works fine but when
the
user views on print preview or actually prints the form then the code no
longer works.

Can anyone help with this?

Many thanks in advance.

Martin

Forms are for viewing on screen. Reports are for previewing/printing. Save
your form as a report, by first of all selecting your form in the database
window, then selecting menu option File -> Save As. When the dialog appears,
give the report a name and select 'Report' from the drop-down.

You should find, in the report's class module, that it's current event
contains the same code as your form, so if this doesn't work correctly then
something else is amiss.

Then just replace your code for viewing/printing with a command to open your
report:

DoCmd.OpenReport "MyReport"
 
Thanks, I will try this. i thought I could achieve this via a form as well
as a report.

Thank you for your help.

Martin

Stuart McCall said:
Martin said:
Hello,

I have the following code on a forms On Current property:

Private Sub Form_Current()
If [STATUS] = "Bronze" Then Me.Bronze.Visible = True Else
Me.Bronze.Visible
= False
If [STATUS] = "Silver" Then Me.Silver.Visible = True Else
Me.Silver.Visible
= False
If [STATUS] = "Gold" Then Me.Gold.Visible = True Else Me.Gold.Visible =
False
End Sub

This shows the relevany bitmap based on the field called Status. So if
Status says gold then the Gold symbol is shown. This works fine but when
the
user views on print preview or actually prints the form then the code no
longer works.

Can anyone help with this?

Many thanks in advance.

Martin

Forms are for viewing on screen. Reports are for previewing/printing. Save
your form as a report, by first of all selecting your form in the database
window, then selecting menu option File -> Save As. When the dialog appears,
give the report a name and select 'Report' from the drop-down.

You should find, in the report's class module, that it's current event
contains the same code as your form, so if this doesn't work correctly then
something else is amiss.

Then just replace your code for viewing/printing with a command to open your
report:

DoCmd.OpenReport "MyReport"
 
Back
Top