
Saving records on a form via code
The standard
RunCommand acCmdSaveRecord
saves the *current* form, so is not suitable.
Instead use the Refresh method for your other form.
At the top of your code:
------------------------------------------
Dim frm As Form
Set frm = Forms![MyOtherForm] 'Error if not open.
If frm.Dirty Then
frm.Refresh
End If
Set frm = Nothing
------------------------------------------
Quote:
> In Access 97 I've developed a shipping system. These shipmnents are checked
> against an existing order to check that the shipment information matches what
> was actually ordered (quantity, etc). If there is a mismatch then I'm popping up
> a little window for the user to make a note in to explain why there was a
> difference.
> This seems to work fine if the shipment record has already been saved.
> However, these checks are also done when the shipment record is being input (a
> lot of the default information is pulled through from the order). When the
> record hasn't been saved and this note window is brought up, the note isn't
> being saved.
> The note field is called via code in the shipment form, a the shipment ID is put
> into one of the note fields - to link them together.
> The only solution that I can think of is to save the shipment record before
> displaying this note field. Can this be done via code - I can't seem to find it.
,~,_/\
/ \ Allen Browne
{ Perth } Australia
*_,~~\_/ http://odyssey.apana.org.au/~abrowne/
v