T
Tina
Now, when I click on the add button on get the error
message "type mismatch". Here's the code behind my form.
Am I missing something?????
Option Explicit
Option Compare Database
Private Sub CustomerID_AfterUpdate()
'Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[CustID] = '" & Me![CustomerID] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Delete_Click()
On Error GoTo Err_Delete_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, ,
acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, ,
acMenuVer70
Exit_Delete_Click:
Exit Sub
Err_Delete_Click:
MsgBox Err.Description
Resume Exit_Delete_Click
End Sub
Private Sub Add_Record_Click()
On Error GoTo Err_Add_Record_Click
DoCmd.GoToRecord , , acNewRec
Dim res As Long
res = DMax("System_ID", "System Information") + 1
Exit_Add_Record_Click:
Exit Sub
Err_Add_Record_Click:
MsgBox Err.Description
Resume Exit_Add_Record_Click
End Sub
Private Sub Open_Service_Card_Click()
On Error GoTo Err_Open_Service_Card_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Service Cards"
stLinkCriteria = "[System_ID]=" & "'" & Me![System_ID]
& "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Open_Service_Card_Click:
Exit Sub
Err_Open_Service_Card_Click:
MsgBox Err.Description
Resume Exit_Open_Service_Card_Click
End Sub
message "type mismatch". Here's the code behind my form.
Am I missing something?????
Option Explicit
Option Compare Database
Private Sub CustomerID_AfterUpdate()
'Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[CustID] = '" & Me![CustomerID] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Delete_Click()
On Error GoTo Err_Delete_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, ,
acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, ,
acMenuVer70
Exit_Delete_Click:
Exit Sub
Err_Delete_Click:
MsgBox Err.Description
Resume Exit_Delete_Click
End Sub
Private Sub Add_Record_Click()
On Error GoTo Err_Add_Record_Click
DoCmd.GoToRecord , , acNewRec
Dim res As Long
res = DMax("System_ID", "System Information") + 1
Exit_Add_Record_Click:
Exit Sub
Err_Add_Record_Click:
MsgBox Err.Description
Resume Exit_Add_Record_Click
End Sub
Private Sub Open_Service_Card_Click()
On Error GoTo Err_Open_Service_Card_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Service Cards"
stLinkCriteria = "[System_ID]=" & "'" & Me![System_ID]
& "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Open_Service_Card_Click:
Exit Sub
Err_Open_Service_Card_Click:
MsgBox Err.Description
Resume Exit_Open_Service_Card_Click
End Sub