Save a record in a form (from another form)

wildsyp

Registered User.
Local time
Today, 11:58
Joined
Oct 15, 2008
Messages
19
Hi,

I have a frustrating problem trying to save a record on a form.

I basically have two forms, the first is the primary form which is linked into my main table where most of my data is scored.

I have a secondary form which the user would use to input data into the first form (I do this for data validation reasons)

This works fine, but all I am trying to is save the record in the primary form from the second form once a update has been made. If the user decides to close the primary form without saving changes, the updates drop out. I need to force the record to save (from the secondary form) no matter if the user saves changes or not.

I hope this makes sense! I am sure there is a very simple piece of code I am missing.

Thanks
Paul
 
I need to force the record to save (from the secondary form) no matter if the user saves changes or not.
What's the purpose of the secondary form then?:confused:
 
I always prefer to pass data using tables.

Why not write the data directly to the table(s) from the second form?

I would also add Also, a check to the first form's Un Load event to test to see if the second form is open. If the second form IsLoaded then cancel the close attempt.

Example
Code:
Private Sub Form_Unload(Cancel As Integer)

    If CurrentProject.AllForms("Form2").IsLoaded = True Then

      MsgBox "Must close form 2 before you can close form 1!"
      Cancel = True

    End If

End Sub
 

Users who are viewing this thread

Back
Top Bottom