Results 1 to 3 of 3

Thread: Type Mismatch

  1. #1
    Lounger
    Join Date
    Sep 2005
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am sure this is something easy I am missing but I can't figure out why i get this Type Mismatch error. I have enclosed a smaller version of the database. If you open up the database and go into Review Workorders - then highlight a workorder and click the "Print WO" button. When i did some debug.print statements it looks like it gets the right workorder number but i get the Type Mismatch.

    Any thoughts?

    Thanks


    This is the code behind the "Print WO" button:
    Dim strDocName As String
    Dim frm As Form, ctl As Control
    Dim varItm As Variant

    strDocName = "WOPrintFormNew"

    Set frm = Forms!WOListForm
    Set ctl = frm!List
    For Each varItm In ctl.ItemsSelected
    DoCmd.OpenReport strDocName, , , , "[WorkorderNo]=" & "'" & Me.List.Column(0) & "'"
    Next varItm
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You have one comma too many in the DoCmd.OpenReport line. It should be

    DoCmd.OpenReport strDocName, , , "[WorkorderNo]=" & "'" & Me.List.Column(0) & "'"

  3. #3
    Lounger
    Join Date
    Sep 2005
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I knew it was something simple. Thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •