A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Printing an uncommitted record



 
 
Thread Tools Display Modes
  #1  
Old August 19th, 2006, 03:28 AM posted to microsoft.public.access.forms
Darrell
external usenet poster
 
Posts: 53
Default Printing an uncommitted record

I have a problem which I repeatedly encounter. I need the user to be
able to print a report which is based on a record just entered, BUT NOT
YET COMMITTED. How do I commit the record when the user clicks "Print"?
It seems like it should be an absurdly simple problem to solve, but I
find myself struggling to do so. Is there no way besides elaborate code
blocks which capture the Bookmark (or a primary key), then requeries,
then returns to the record-of-origin? That seems like a lot of work
merely to commit a record before printing it. Am I missing something?

Thanks in advance for your help.

Darrell
  #2  
Old August 19th, 2006, 04:00 AM posted to microsoft.public.access.forms
Pat Hartman\(MVP\)
external usenet poster
 
Posts: 124
Default Printing an uncommitted record

It is so simple that you'll probably dent your forehead when you go duh!

A single line of code, placed prior to the OpenReport or OpenForm Method is
all it takes.

DoCmd.RunCommand acCmdSaveRecord

"Darrell" wrote in message
...
I have a problem which I repeatedly encounter. I need the user to be able
to print a report which is based on a record just entered, BUT NOT YET
COMMITTED. How do I commit the record when the user clicks "Print"? It
seems like it should be an absurdly simple problem to solve, but I find
myself struggling to do so. Is there no way besides elaborate code blocks
which capture the Bookmark (or a primary key), then requeries, then returns
to the record-of-origin? That seems like a lot of work merely to commit a
record before printing it. Am I missing something?

Thanks in advance for your help.

Darrell



  #3  
Old August 19th, 2006, 01:20 PM posted to microsoft.public.access.forms
Albert D. Kallal
external usenet poster
 
Posts: 2,874
Default Printing an uncommitted record

For years, to send the current reocrd to the printer, I build a reprot...

me.Refresh ' this commits the reocrd
docmd.OpenReport "rptCustomer",,,"id = " & me!report

So, you can use me.Refresh



--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada



  #4  
Old August 20th, 2006, 03:31 AM posted to microsoft.public.access.forms
Pat Hartman\(MVP\)
external usenet poster
 
Posts: 124
Default Printing an uncommitted record

Although Refresh and Requery will both save the current record, that isn't
their function. It is a side effect. For clarity and for the sake of
myself and others who might read the code in the future, I prefer to use the
instruction that saves the current record and doesn't do anything else.
When I want to refresh the form, I use .Refresh and when I want to requery
it, I use Requery and reposition the record pointer if necessary. People
post all the time about the unintended side effects of Requery especially.

"Albert D. Kallal" wrote in message
...
For years, to send the current reocrd to the printer, I build a reprot...

me.Refresh ' this commits the reocrd
docmd.OpenReport "rptCustomer",,,"id = " & me!report

So, you can use me.Refresh



--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada




  #5  
Old August 20th, 2006, 09:51 PM posted to microsoft.public.access.forms
Darrell
external usenet poster
 
Posts: 53
Default Printing an uncommitted record

Pat Hartman(MVP) wrote:
It is so simple that you'll probably dent your forehead when you go duh!

A single line of code, placed prior to the OpenReport or OpenForm Method is
all it takes.

DoCmd.RunCommand acCmdSaveRecord

"Darrell" wrote in message
...
I have a problem which I repeatedly encounter. I need the user to be able
to print a report which is based on a record just entered, BUT NOT YET
COMMITTED. How do I commit the record when the user clicks "Print"? It
seems like it should be an absurdly simple problem to solve, but I find
myself struggling to do so. Is there no way besides elaborate code blocks
which capture the Bookmark (or a primary key), then requeries, then returns
to the record-of-origin? That seems like a lot of work merely to commit a
record before printing it. Am I missing something?

Thanks in advance for your help.

Darrell



Thank you, thank you, thank you! I KNEW it couldn't be so complicated! I
didn't know the docmd method existed, and THAT is what I should probably
be denting my forehead for!

Thank you again!

Darrell
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.