Results 1 to 3 of 3
  1. #1
    nick243 is offline Competent Performer
    Windows 7 64bit Access 2002
    Join Date
    May 2016
    Posts
    185

    Runtime error

    Private Sub Command69_Click()


    Dim idVar
    idVar = Forms![D-E-1-LineHaul]![D-E-2-LineHaul-Shipment_Detail]!ID
    DoCmd.OpenReport "TX-TrailerUnloadReport", acViewPreview, , "ShipmentID = " & idVar
    End Sub

    Hi,

    I am getting a run time error of 3464 data type mismatch in criteria expression. I run the debugger and it highlights the line docmd.OpenReport. I have compared a previous copy of the code in working form and it appears to be the same code. Is this just human error?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Use the BUILDER to get the path names correct...
    if [D-E-2-LineHaul-Shipment_Detail] is a sub form, then the syntax is:

    idVar = Forms![D-E-1-LineHaul]![D-E-2-LineHaul-Shipment_Detail].form!ID

    BUILDER will always spell it right.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    If the field is text, you need delimiters:

    http://www.baldyweb.com/wherecondition.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 02-26-2016, 12:34 PM
  2. Replies: 2
    Last Post: 08-22-2015, 11:26 AM
  3. Runtime 438 error
    By Thompyt in forum Programming
    Replies: 2
    Last Post: 06-04-2015, 10:35 AM
  4. Replies: 2
    Last Post: 10-15-2014, 04:23 AM
  5. Replies: 13
    Last Post: 06-12-2012, 09:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums