Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Bristol, Avon, England
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dlookup filter string (2k)

    I am having problems creating a filter string for a query.

    I want to look up a unit price based of two parameters 1)Customer Type and 2) Service type. I have a table which has a Product field which contains data such as INT20 or EXT10 (Internal Customer 20 day service / External Customer 10day service)

    I have tried the following DLOOKUP but I think I have a problem with the string (probably with quotes)

    DLookUp("UnitPrice","tblProducts","Product = " & Left([custtype],3) & Left([servicetype],2))

    Any ideas?

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dlookup filter string (2k)

    Missing quotes are probably the cause of the problem. Try

    DLookUp("UnitPrice","tblProducts","Product = " & Chr(34) & Left([custtype],3) & Left([servicetype],2) & Chr(34))

    Chr(34) is the double quote character.

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17> It would be nice if you provided some feedback to the replies you receive. If you don't, neither the one who bothered to reply, nor other Loungers reading the thread know whether is was helpful or not. Thanks in advance! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  3. #3
    2 Star Lounger
    Join Date
    May 2002
    Location
    Bristol, Avon, England
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dlookup filter string (2k)

    Hans,

    Thank - you. That worked perfectly. I always get muddled with quotes. The Chr(34) is a great tip for this and future strings

Posting Permissions

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