Option Compare Database
Option Explicit
Private Sub New_Customer_Click()
On Error GoTo Err_New_Customer_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Customers"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_New_Customer_Click:
Exit Sub
Err_New_Customer_Click:
MsgBox Err.Description
Resume Exit_New_Customer_Click
End Sub
Private Sub New_Vendor_Click()
On Error GoTo Err_New_Vendor_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Vendors"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_New_Vendor_Click:
Exit Sub
Err_New_Vendor_Click:
MsgBox Err.Description
Resume Exit_New_Vendor_Click
End Sub
Private Sub List51_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Me![List51])
Me.Bookmark = rs.Bookmark
End Sub
Private Sub Combo53_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Me![Combo53])
Me.Bookmark = rs.Bookmark
End Sub
Private Sub Next_Record_Click()
On Error GoTo Err_Next_Record_Click
DoCmd.GoToRecord , , acNext
Exit_Next_Record_Click:
Exit Sub
Err_Next_Record_Click:
MsgBox Err.Description
Resume Exit_Next_Record_Click
End Sub
Private Sub Save_Record_button_Click()
On Error GoTo Err_Save_Record_button_Click
DoCmd.RunCommand acCmdSaveRecord
Exit_Save_Record_button_Click:
Exit Sub
Err_Save_Record_button_Click:
MsgBox Err.Description
Resume Exit_Save_Record_button_Click
End Sub
Private Sub Go_to_last_record_Click()
On Error GoTo Err_Go_to_last_record_Click
DoCmd.GoToRecord , , acLast
Exit_Go_to_last_record_Click:
Exit Sub
Err_Go_to_last_record_Click:
MsgBox Err.Description
Resume Exit_Go_to_last_record_Click
End Sub
Private Sub Previous_record_Click()
On Error GoTo Err_Previous_record_Click
DoCmd.GoToRecord , , acPrevious
Exit_Previous_record_Click:
Exit Sub
Err_Previous_record_Click:
MsgBox Err.Description
Resume Exit_Previous_record_Click
End Sub
Private Sub Close_Form_Click()
On Error GoTo Err_Close_Form_Click
If Me.Dirty Then Me.Dirty = False
DoCmd.Close
Exit_Close_Form_Click:
Exit Sub
Err_Close_Form_Click:
MsgBox Err.Description
Resume Exit_Close_Form_Click
End Sub