access2010
Registered User.
- Local time
- Today, 02:13
- Joined
- Dec 26, 2009
- Messages
- 1,022
Hello, how could I have one control button to save an entry and than close the form?
At the present time we have two control buttons.
Thank you,
Nicole
===
Save Record
===
Private Sub Save_Record_Click()
On Error GoTo Err_Save_Record_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_Save_Record_Click:
Exit Sub
Err_Save_Record_Click:
MsgBox Err.Description
Resume Exit_Save_Record_Click
End Sub
===
Close form
===
Private Sub Com_exit_Click()
If Me.Dirty And IsNull(Me![Envelope#]) Then
MsgBox "Please enter the vendor envelope number."
Else
DoCmd.Close acForm, Me.Name
End If
End Sub
At the present time we have two control buttons.
Thank you,
Nicole
===
Save Record
===
Private Sub Save_Record_Click()
On Error GoTo Err_Save_Record_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_Save_Record_Click:
Exit Sub
Err_Save_Record_Click:
MsgBox Err.Description
Resume Exit_Save_Record_Click
End Sub
===
Close form
===
Private Sub Com_exit_Click()
If Me.Dirty And IsNull(Me![Envelope#]) Then
MsgBox "Please enter the vendor envelope number."
Else
DoCmd.Close acForm, Me.Name
End If
End Sub