Re: Help with VB statement

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Ken Snell [MVP] (kthsneisllis9_at_ncoomcastt.renaetl)
Date: 12/15/04


Date: Wed, 15 Dec 2004 14:56:41 -0500

Assuming that you're wanting to use the controls on the form:

LookedUpValue = DLookup("FieldName", "TableName", "[Field1]=" &
Me.Control1.Value & " And [Field2]=" & Me.Control2.Value)

-- 
        Ken Snell
<MS ACCESS MVP>
"David" <David@discussions.microsoft.com> wrote in message
news:5F316C53-7137-4074-B058-20A1CDDA4255@microsoft.com...
> Hello,
>
> I have one form with a total of three fields.  This form is based of lets
> say Table1. I would like to use the data in field 1 and 2 together to
lookup
> in table2 for the data for field 3.  I cant figure out how to use Dlookup
for
> this.
>
> Any help would be great thank you
>
> David


Relevant Pages

  • Re: Mainform / subform / popup form
    ... "Ken Snell " wrote: ... <MS ACCESS MVP> ... themselves or to controls bound to the fields? ... Inspections form -- do you use DoCmd.OpenForm action? ...
    (microsoft.public.access.forms)
  • Re: Mainform / subform / popup form
    ... <MS ACCESS MVP> ... "Ken Snell " wrote: ... themselves or to controls bound to the fields? ... Inspections form -- do you use DoCmd.OpenForm action? ...
    (microsoft.public.access.forms)
  • Re: Mainform / subform / popup form
    ... <MS ACCESS MVP> ... "Ken Snell " wrote: ... themselves or to controls bound to the fields? ... Inspections form -- do you use DoCmd.OpenForm action? ...
    (microsoft.public.access.forms)
  • Re: Sum of IIF
    ... replace them with the actual field names -- Sum ... will not work on controls' values. ... Ken Snell ... <MS ACCESS MVP> ...
    (microsoft.public.access.reports)
  • Re: Function RATE does not work
    ... <MS ACCESS MVP> ... "David C. Holley" wrote in message ... > Ken Snell wrote: ...
    (microsoft.public.access.modulesdaovba)