Close form with another form saving record first

Dan25e

Registered User.
Local time
Today, 11:35
Joined
Dec 3, 2014
Messages
33
Hi Folks,

I need a nudge please.

I have a timer form which closes the database after a period of time with DoCmd.Quit. Another form is open at this point but if a user has left it in the middle of editing it I want to be able to save the record in the other form and close it before the timer form closes the database.

What VBA do I need in the timer form to save the record and close the other form before DoCmd.Quit?

Just to be clear the code is...

Private Sub Form_Timer()

On Error Resume Next

Me.Tag = Val(Me.Tag) - (Me.TimerInterval / 1000)

Me.Caption = "The database will exit in " & Me.Tag & " seconds"

If Val(Me.Tag) <= 0 Then

'Code here to save record in DPL Form
'Code that closes the DPL Form

DoCmd.Quit

End If

End Sub


Thanks in advance
 
records are saved automatically when you leave the form / table / record.
 

Users who are viewing this thread

Back
Top Bottom