Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dlookup question (97)

    The following dlookup complains that my criteria is incorrect & doesn

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Dlookup question (97)

    Hi,
    Try changing your expression to:
    Me.Text106 = DLookup("blendpercentage", "blendpercentages", "month=<font color=red>'</font color=red>" & Choose(month(Date), "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec") & "<font color=red>'</font color=red>")
    As you're returning a string from your choose function, you need to enclose it in quotes in the criteria string.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dlookup question (97)

    i'll be damned, thanks it worked! now i'm working on the 2nd half of my thread.

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Dlookup question (97)

    Sorry - I overlooked that bit.
    Try:
    Me.Text106 = DLookup("blendpercentage", "blendpercentages", "month='" & Choose(month(Date), "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec") & "' And type = 'OA'")*Me!Text101
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dlookup question (97)

    thank you!

Posting Permissions

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