Print current record

  • Thread starter Thread starter Nathan
  • Start date Start date
N

Nathan

I have a form created for viewing and editing 'Customer
Orders' and on this form I have a button to 'preview' the
current record (or form presented as a reort which is
created from a query). When I press this button now, I
get every single record previewed as a report in the
database. I just want the button to be pressed to
show 'only' the current record displayed. How do I do
this?? Please help, all I want is a simple and easy way
to do this as I do not know how to use VBA or macro's
(I'm still learning). Cheers.
 
Nathan said:
I have a form created for viewing and editing 'Customer
Orders' and on this form I have a button to 'preview' the
current record (or form presented as a reort which is
created from a query). When I press this button now, I
get every single record previewed as a report in the
database. I just want the button to be pressed to
show 'only' the current record displayed. How do I do
this?? Please help, all I want is a simple and easy way
to do this as I do not know how to use VBA or macro's
(I'm still learning). Cheers.


Two ways to do this. The better way is to modify the code
behind the button's Click event so that it looks more like
this:

Dim stDoc As String
Dim stWhere As String
stDoc = "nameof report"
stWhere = "keyfield = " & Me.keyfield
DoCmd.OpenReport stDoc, acViewPreview, , stWhere
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top