Results 1 to 5 of 5
  1. #1
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481

    Dlook Up

    Hey there,

    I have master table for items "TblItem"

    i am using combo box look up at form to insert data where i need to find the length of item from master table if [LenghtMtr]

    i am using this function:

    LengthMtr = DLookup("LengthMtr", "tblItem", "ItemID =" & ItemID)

    Error is:

    Runtime Error "3075"

    Syntax Error (missing operator) in query expression 'ItemID = Pipe ES300'


    please advise whats wrong with it?




    thanks

    zee

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    If the Item ID is coming from a form then you need to identify the form in your lookup.

    ie. = DLookup("LengthMtr", "tblItem", "ItemID =" & Forms!YourFormName.ItemID)

  3. #3
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Sir,

    I am using a form where control source is ItemID and field is combo look up at form level. the row source is from table "tblItem"

    the next field is LengthMtr which is also a part of TblItem. so i just want to pull the data when select the item from ItemId Combo so "afterupdate" event the length must be update.

    is it the problem because of:

    The master tblItem having

    ItemID PK
    Description
    Shortname
    LenghtMtr

    so in above combo box i am bound to column 2 where i select Shortname.

    please advise.

    thanks

    zee

  4. #4
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    ie. = DLookup("LengthMtr", "tblItem", "ItemID =" & Forms!YourFormName.ItemID)
    Did you try this and if so, what was the result?

    Here is the syntax for dlookup

    Pay attention to the Apostrophes depending on what you are retrieving and from where.

    http://www.techonthenet.com/access/f...in/dlookup.php

  5. #5
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Sir the result was same as before. i think there is some thing which i am missing. sure i will try this and will revert to you soon. thanks

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

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