Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2012
    Posts
    68

    Unanswered: Compile error With =dlookup

    So here is the bit of code im getting the error on. Its an after_update code.

    Code:
    taxstatus = DLookup("[taxstatus]", "jobs", "[Job Number] ='" & Me.jid & "'")
    taxstatus (textbox) = Look up the tax status from the jobs table where the job number (field) is = to jid(field from jobs table).

    I have this code used on other functions and it works fine. Im wondering if it has something to do with numbers instead of text.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    If [Job Number] is defined as numeric, use:
    Code:
    taxstatus = DLookup("taxstatus", "jobs", "[Job Number] =" & Me.jid )
    Have a nice day!

  3. #3
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,422
    Provided Answers: 8
    Or if the record is not there it will also error.
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  4. #4
    Join Date
    Mar 2012
    Posts
    68
    thanks for the help. I seem to figure it out after i post all the time. I'll be posting something else i just cant figure out.

Posting Permissions

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