How to report record just inserted?

GordonR

Registered User.
Local time
Today, 00:51
Joined
Aug 19, 2003
Messages
29
I have a subform which shows prices for a given supplier that relate to a product (the mainform). The user clicks on a command button in the subform to create a new order for that supplier/price and the pop-up has a confirm button that when clicked runs an INSERT SQL statement to add the new order. I want to print the order details but the key (unique primary) is an autonumber and so generated by access - how can I identify the record I have just written?
Thanks for any help!
 
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport, "[MyID]=" & Me!MyID
 
Thanks for the reply Rich.
The problem is that the form is unbound. Also, I would not expect the acCmdSaveRecord to be valid as the record is actually being created via the SQL INSERT (actually done with an doCmd.OpenQuery).
Thanks for helping.
 

Users who are viewing this thread

Back
Top Bottom