Printing a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I used the wizard create a cmd button to print the current form. I looked at
the code and the cmd looks like DoCmd.PrintOut . Unfortuetly , it seems
that it is printing every record in the query used to feed the form. Is
there a way to limit to the record that is currently opened in the form.
 
hi,
instead of printing the table bound to the form, write a
query that selects the last record in the table.(MAX
control number maybe) then printout the query which only
has 1 record in it.
note: unless you have some way of limiting the data,
docmd.printout will print everything.
 
I used the wizard create a cmd button to print the current form. I looked at
the code and the cmd looks like DoCmd.PrintOut . Unfortuetly , it seems
that it is printing every record in the query used to feed the form. Is
there a way to limit to the record that is currently opened in the form.

Forms are best reserved for onscreen use; use a Report for printing.
You can save a Form as a Report to save the effort of building it from
scratch.

Base the Report not on the Table, but on a Query referencing the form
control containing the unique key identifying the record to be
printed: e.g. use

=[Forms]![YourFormName]![ID_Controlname]

on the criteria line.

John W. Vinson[MVP]
 
I think I have a simpler answer.

DoCmd.PrintOut acSelection

It limits to the current record.

Thanks for all the suggestions

John Vinson said:
I used the wizard create a cmd button to print the current form. I looked at
the code and the cmd looks like DoCmd.PrintOut . Unfortuetly , it seems
that it is printing every record in the query used to feed the form. Is
there a way to limit to the record that is currently opened in the form.

Forms are best reserved for onscreen use; use a Report for printing.
You can save a Form as a Report to save the effort of building it from
scratch.

Base the Report not on the Table, but on a Query referencing the form
control containing the unique key identifying the record to be
printed: e.g. use

=[Forms]![YourFormName]![ID_Controlname]

on the criteria line.

John W. Vinson[MVP]
 
Back
Top