Print Questions

  • Thread starter Thread starter DavidW
  • Start date Start date
D

DavidW

1. Is there a way to set the print area
I have got a form in single form view, all it is is a form with a combobox
so the user can select a date to view the form by. When you click print
preview or print the form it prints all of the records. How do you set it to
the curruent form.

2. Is there a way you can change all of the fonts to black for printing only
and leave the form colr fonts alone. The are some fonts that are white and
when you select print data only ,the fonts that are white dont show up on a
white sheet.
Thanks
David
 
Hi David,

I think the best aproach is to use a report for printing and a form for the
user interface.

This way you can have what ever formating you want.

Once you have created a report (using the wizard if you wish) then code like
the following will print the current record:

DoCmd.OpenReport "rptName", acPreview, , "[id] = " & Me.[id]

Replace the ID with the name of the primary key (i.e. the field that
uniquely identifies each record).

HTH

--

Cheers
Mark

Free Access/Office Add-Ins at:
http://mphillipson.users.btopenworld.com/
 
David, the answer to both your questions it to create a Report that shows
the data exactly as you want it.

You can open the report with a command button. For example, if your combo is
named "MyCombo", and it contains a date to match against a field named
InvoiceDate, the Click event procedure of the button would look like this:

Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then 'Save first.
Me.Dirty = False
End If
If Not IsNull(Me.MyCombo) then
strWhere = "[InvoiceDate] = " & _
Format(Me.MyCombo, "\#mm\/dd\/yyyy\#")
End If
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End Sub
 
Back
Top