Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Another DLookup Question

Discussion in 'Information Technology' started by Mac, Jul 28, 2006.

  1. Mac

    Mac
    Expand Collapse
    Guest

    Dear All,

    Like so many I'm getting headaches and mildly suicidal over syntax for
    DLookup. I have a dlookup that looks at an integer value and will
    hopefully return another integer value from another table as long as it
    is within a set range. The formula is shown below, when I run it, I'm
    getting an error. Can anyone help?

    Thanks in advance.

    Andy

    =DLookUp("Startnumber","ChequeBooks","forms!ChequeBookRecord!ChqNo=" &
    "([Startnumber]<=[ChqNo]=>[EndNumber])")
     
  2. Loading...

    Similar Threads Forum Date
    Sikhism More Than Just Another Religion New to Sikhism Jul 25, 2016
    Yet Another Show Of Support For Sikhs From Canada! Breaking News Apr 28, 2016
    Another funny story, and Rory is castrated Blogs Oct 17, 2015
    Another week, another wolf Blogs Oct 17, 2015
    easy, develop another addiction! Blogs Oct 16, 2015

  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    Try:
    =DLookUp("Startnumber", "ChequeBooks",
    Nz(Forms!ChequeBookRecord!ChqNo,0) & " Between [Startnumber] And
    [EndNumber]")

    If this text box is actually on the ChequeBookRecord form, just use:
    =DLookUp("Startnumber", "ChequeBooks",
    Nz(ChqNo,0) & " Between [Startnumber] And [EndNumber]")

    This assumes ChqNo is a Number type field. If it is a Text field, you need
    extra quotes.

    The Nz() avoids the error that would occur when ChqNo is blank (e.g. at a
    new record.)

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Mac" <andrew.mcintyre@rcag.org.uk> wrote in message
    news:1150444866.538102.209510@y41g2000cwy.googlegroups.com...
    > Dear All,
    >
    > Like so many I'm getting headaches and mildly suicidal over syntax for
    > DLookup. I have a dlookup that looks at an integer value and will
    > hopefully return another integer value from another table as long as it
    > is within a set range. The formula is shown below, when I run it, I'm
    > getting an error. Can anyone help?
    >
    > Thanks in advance.
    >
    > Andy
    >
    > =DLookUp("Startnumber","ChequeBooks","forms!ChequeBookRecord!ChqNo=" &
    > "([Startnumber]<=[ChqNo]=>[EndNumber])")
     
  4. Mac

    Mac
    Expand Collapse
    Guest

    Dear Allen,

    Yet again, many thanks, it worked a treat.

    Regards

    Andy
     

Share This Page