General discussion
July 2, 2002 at 12:07 AM
carljohnman

Force action on a form

by carljohnman . Updated 24 years, 2 months ago

I have the code below inserted for a command button called “next” which brings up the second form in order to enter data. I was hoping someone could tell me where and how to NOT allow this action to occur unless the user saves the record first (I placed a save record command button on the same form with the “next” command.)
So, if you are a user you can enter data into the form but until you save it, you will not proceed. Thanks in advance for any help.

Private Sub Command28_Click()
On Error GoTo Err_Command28_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = “Probatedb Test Form1”
DoCmd.OpenForm stDocName, acNormal, , , , , Me![Probatedb TestID]

DoCmd.Close acForm, Me.Name

Exit_Command28_Click:
Exit Sub

Err_Command28_Click:
MsgBox Err.Description
Resume Exit_Command28_Click

End Sub

This discussion is locked

All Comments