G
Guest
When I click on a command button with the following code, I get a Type
Mismatch Code. Although the error message shows "Type Mismatch" it opens the
form and lets me save any changes, etc. Can anyone think of a reason why it
would give me this error? I have checked that all the fields are the same
data type. Thanks.
Private Sub cmdbtnProgressNotes_Click()
On Error GoTo Err_cmdbtnProgressNotes_Click
Dim strLinkCriteria As String
Dim strDocName As String
strDocName = "subfrmToDoProgressNotes"
' If ToDoInstructionsID control is blank, display a message.
If IsNull(Me![ToDoInstructionsID]) Then
Me![ToDoProgressNotesID].SetFocus
Else
' Otherwise, open Product List form, showing products for current
supplier.
strDocName = "subfrmToDoProgressNotes"
strLinkCriteria = "[ToDoInstructionsID]=" & Me![ToDoInstructionsID]
DoCmd.OpenForm strDocName, , , strLinkCriteria
DoCmd.OpenForm strDocName, acFormAdd, , , strLinkCriteria
End If
Exit_cmdbtnProgressNotes_Click:
Exit Sub
Err_cmdbtnProgressNotes_Click:
MsgBox Err.Description
Resume Exit_cmdbtnProgressNotes_Click
End Sub
Mismatch Code. Although the error message shows "Type Mismatch" it opens the
form and lets me save any changes, etc. Can anyone think of a reason why it
would give me this error? I have checked that all the fields are the same
data type. Thanks.
Private Sub cmdbtnProgressNotes_Click()
On Error GoTo Err_cmdbtnProgressNotes_Click
Dim strLinkCriteria As String
Dim strDocName As String
strDocName = "subfrmToDoProgressNotes"
' If ToDoInstructionsID control is blank, display a message.
If IsNull(Me![ToDoInstructionsID]) Then
Me![ToDoProgressNotesID].SetFocus
Else
' Otherwise, open Product List form, showing products for current
supplier.
strDocName = "subfrmToDoProgressNotes"
strLinkCriteria = "[ToDoInstructionsID]=" & Me![ToDoInstructionsID]
DoCmd.OpenForm strDocName, , , strLinkCriteria
DoCmd.OpenForm strDocName, acFormAdd, , , strLinkCriteria
End If
Exit_cmdbtnProgressNotes_Click:
Exit Sub
Err_cmdbtnProgressNotes_Click:
MsgBox Err.Description
Resume Exit_cmdbtnProgressNotes_Click
End Sub