Results 1 to 2 of 2
  1. #1
    msaccessdev is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2014
    Posts
    13

    #Error in the query expression

    Hi There,

    I am trying to join 2 tables based on the Employee ID and pulling out order name details. I have written a query and with in the query i have written a function something like this

    OrdDetails: Left([OrdDet],InStr([OrdDet]," ")-1))

    and it is running fine for the records that are matching in the tables. If there is no record in the first table then this expression throwing an error "#Error".



    please advice.

  2. #2
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    Check the [OrdDet] and skip the left if it is null. Try this. (Code not tested)

    OrdDetails: IIF(ISNULL([OrdDet]), [OrdDet], Left([OrdDet],InStr([OrdDet]," ")-1)))

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

Similar Threads

  1. Replies: 11
    Last Post: 05-01-2014, 11:56 AM
  2. Replies: 3
    Last Post: 03-05-2013, 11:17 AM
  3. Replies: 4
    Last Post: 07-25-2012, 04:01 AM
  4. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  5. Error 3075 |1 In Query Expression '|2'
    By bishop in forum Access
    Replies: 3
    Last Post: 10-15-2011, 06:56 AM

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