P
Paul
I am having a problem with the "Type Mismtach" error whenever I fire off an
Access application. Both of the front and back end was built using Access
2002. This error message is only appeared on my client's computer which is
running on Office XP same as my development computer. However this error
does not show up on my devcelopment computer. I copied the code below to
indicate the line where it broke off and I do not see any error on the
coding. I would be grateful if anyone can give me some idea on how to fix
this. Thanks.
Private Sub btnInvoice_Click()
Dim rs As DAO.Recordset
Dim frm As Form
On Error GoTo Err_btnInvoice_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70.........(It breaks off here)
Dim stDocName As String
stDocName = "Rpt_Invoice"
Set frm = Forms![Frm_sales]![Frm_Sales Subform].Form
Set rs = frm.RecordsetClone
If rs.RecordCount = 0 Then
If MsgBox("There is no item entered for the purchase." & vbCrLf &
"Click Yes to close the form." & vbCrLf & "Click No to go back to enter
item.", vbYesNo, "Invoicing System") = vbYes Then
DoCmd.Close
DoCmd.OpenForm "Switchboard"
Else
DoCmd.CancelEvent
End If
Else
If Me.Region = "USA" Then
DoCmd.OpenReport "Rpt_US Invoice", acViewPreview, , , , 1
Else
DoCmd.OpenReport "Rpt_Invoice", acViewPreview, , , , 1
End If
End If
Exit_btnInvoice_Click:
Exit Sub
Err_btnInvoice_Click:
MsgBox Err.Description
Resume Exit_btnInvoice_Click
End Sub
Access application. Both of the front and back end was built using Access
2002. This error message is only appeared on my client's computer which is
running on Office XP same as my development computer. However this error
does not show up on my devcelopment computer. I copied the code below to
indicate the line where it broke off and I do not see any error on the
coding. I would be grateful if anyone can give me some idea on how to fix
this. Thanks.
Private Sub btnInvoice_Click()
Dim rs As DAO.Recordset
Dim frm As Form
On Error GoTo Err_btnInvoice_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70.........(It breaks off here)
Dim stDocName As String
stDocName = "Rpt_Invoice"
Set frm = Forms![Frm_sales]![Frm_Sales Subform].Form
Set rs = frm.RecordsetClone
If rs.RecordCount = 0 Then
If MsgBox("There is no item entered for the purchase." & vbCrLf &
"Click Yes to close the form." & vbCrLf & "Click No to go back to enter
item.", vbYesNo, "Invoicing System") = vbYes Then
DoCmd.Close
DoCmd.OpenForm "Switchboard"
Else
DoCmd.CancelEvent
End If
Else
If Me.Region = "USA" Then
DoCmd.OpenReport "Rpt_US Invoice", acViewPreview, , , , 1
Else
DoCmd.OpenReport "Rpt_Invoice", acViewPreview, , , , 1
End If
End If
Exit_btnInvoice_Click:
Exit Sub
Err_btnInvoice_Click:
MsgBox Err.Description
Resume Exit_btnInvoice_Click
End Sub