Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mismatch Error

Status
Not open for further replies.

Dom606

IS-IT--Management
Jul 29, 2007
123
US
I have the following code, which is simply to open a query from a command button. However, I get Type Mismatch error when the code reaches the line in red.

Code:
Private Sub Excel_Time_Click()
    On Error GoTo PreviewExcel_Time_Err
    If IsNull(Me![TimeCardID]) Then
        MsgBox "Enter time card information before previewing the Time Card Query."
    Else
        [COLOR=red]DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70[/color]
        DoCmd.OpenQuery "WorkCode_Crosstab", acPreview, "[TimeCardID]=" & [TimeCardID]
    End If

PreviewExcel_Time_Exit:
    Exit Sub

PreviewExcel_Time_Err:
    MsgBox Err.Description
    Resume PreviewExcel_Time_Exit
End Sub
 
Thank you Duane. That worked.
Dom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top