Write / Print Same Record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subForm populated from a main form, but I only write the record if
specific conditions are met. Once they are met though, I want the user to
click a button on the subform and add the record and print that specific
record at the same time.

I was trying to use AddNewRec, but I can't do that because once they add the
record that way, the subForm clears and the button gives an error message.
Is there a way to update the table and print that same record? For example
instead of an AddNewRecord, is there an UpdateTable or and UpdateNewRecord?

Any help would be appreciated.
 
I have a subForm populated from a main form, but I only write the record if
specific conditions are met. Once they are met though, I want the user to
click a button on the subform and add the record and print that specific
record at the same time.

I was trying to use AddNewRec, but I can't do that because once they add the
record that way, the subForm clears and the button gives an error message.
Is there a way to update the table and print that same record? For example
instead of an AddNewRecord, is there an UpdateTable or and UpdateNewRecord?

AddNewRecord does just that - it stops what you are doing and adds a new
(blank) record.

To save the current record to disk use

If Me.Dirty Then Me.Dirty = False

or

DoCmd.RunCommand acCmdSaveRecord

You can then use the OpenReport method to open a report to print the record;
use the optional WhereCondition argument to pass a unique ID to specify which
record should be printed.

John W. Vinson [MVP]
 
Back
Top