Button to print current record only

  • Thread starter Thread starter Fatz
  • Start date Start date
F

Fatz

I have a data-entry form that saves the data into a main table. Once
the user pushes "Enter", the "Print Record" button enables so the user
can print the current record. The way I have it set now is that it
takes you to a form where the user manually selects the record to
print. I need to make it so that when the button is clicked only the
current record is selected and automatically printed. I don't even
want the user to see the report...just click the button...teh record
is printed...and they move on to the next entry.

Any thoughts on the best way to do this?? My initial thought was to
append the record to a new table and then run the report off that
table. Once the user prints the record and clicks the "Add New
Record" button a delete query would clear that table and then append
the new record that was added...print it...and so on...

Am I on the right track here?? I appreciate all help and suggestions!

-Chris
 
You just need to set up your report to filter out by
whatever you're using for a recordID. Add a where clause
to your macro or VBA code that searches your control
source for the current record number of the open form when
the report queries.

Something like:

MyTable.RecordID=MyOpenForm.RecordID(this is the control
name...not the field name)
 
There's no reason that it couldn't. We use it here in one
of our databases to email call documentation across the
company. We have a form that we fill out that summarizes
all calls to customers, vendors...etc. When we want other
people in the company to be informed immediately of the
subject matter we have a button on the form that puts the
record into report format and sends the report to the
chosen recipients.
 
That is exactly what I need to do, how do I accomplish
this? And is there a way that have a select box of some
sort to choose my email address from (If I have a
tblEmail, set up?)?

Thanks for your help!

Brook
 
In the Click event of the command button set me.Dirty=False. That will save
the record if it has been modified. Then

DoCmd.OpenReport "rptName", A_NORMAL, , "MyTable.[ShopID] = " & Me![ShopID]

HTH
 
So in turn, can this report be set up to Send Email, by
allowing the user to choose the email receiptiant from a
Table?

Brook
-----Original Message-----
In the Click event of the command button set
me.Dirty=False. That will save
the record if it has been modified. Then

DoCmd.OpenReport "rptName", A_NORMAL, , "MyTable.[ShopID] = " & Me![ShopID]

HTH
--
-Larry-
--

Fatz said:
I have a data-entry form that saves the data into a main table. Once
the user pushes "Enter", the "Print Record" button enables so the user
can print the current record. The way I have it set now is that it
takes you to a form where the user manually selects the record to
print. I need to make it so that when the button is clicked only the
current record is selected and automatically printed. I don't even
want the user to see the report...just click the button...teh record
is printed...and they move on to the next entry.

Any thoughts on the best way to do this?? My initial thought was to
append the record to a new table and then run the report off that
table. Once the user prints the record and clicks the "Add New
Record" button a delete query would clear that table and then append
the new record that was added...print it...and so on...

Am I on the right track here?? I appreciate all help and suggestions!

-Chris


.
 
Back
Top