Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jul 2003
    Location
    Phoenix, Arizona, USA
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DLookUp in Form/Query (2002, SP-2)

    I'm trying to make a work around for my duplicate query issue. I've created a form that looks up what my waiver code is based on the ServiceID and Service Date. The function is:
    =DLookUp("[WaiverCode]","[WaiverCodes]","[SvcID#]= waivercodes!SvcID AND [SvcDate]<=[Waivercodes]![EndDate] AND [SvcDate]>=[Waivercodes]![StartDate]"). This works perfectly in the form.

    Now, to get my billing document out real soon, I tried putting it into a query with this formula:
    Code: DLookUp("[WaiverCode]","[WaiverCodes]",[AuthCodes]![SvcID#] & "=[waivercodes]![SvcID] And " & [BillUnits]![SvcDate] & "<=[WaiverCodes]![Enddate] And " & [BillUnits]![SvcDate] & ">=[WaiverCodes]![StartDate]")

    But I just can't get the function to return the correct data. It needs a match on SvcID, and my SvcDate needs to be between WaiverStart date and WaiverEnddate.

    Please help. Looks like my billing will be late this month.
    Thanks,
    John

  2. #2
    Lounger
    Join Date
    Jul 2003
    Location
    Phoenix, Arizona, USA
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DLookUp in Form/Query (2002, SP-2)

    I was able to solve the DLOOKUP problem. Here is the code I had to use.
    Code: DLookUp("[WaiverCode]","[WaiverCodes]",AuthCodes![SvcID#] & "=[WaiverCodes]![SvcID] and DateValue('" & [SvcDate] & "')" & "Between [WaiverCodes]![StartDate] and [WaiverCodes]![Enddate]")

    Thank you to anyone that was working on it.
    John

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

    Re: DLookUp in Form/Query (2002, SP-2)

    Congratulations for solving it yourself. Does that mean that <post#=342451>post 342451</post#> can be closed?

Posting Permissions

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