Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page