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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
Printing an uncommitted record
|
#4
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|