Re: dlookup problem
- From: "Ken Snell \(MVP\)" <kthsneisllis9@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 7 Dec 2005 13:50:28 -0500
Glad you found the problem.
--
Ken Snell
<MS ACCESS MVP>
"Dan D." <DanD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7BFC336E-EB20-4818-A0EA-592793D1EF77@xxxxxxxxxxxxxxxx
> You did it Ken. I forgot that in Access the table is name differently than
> it
> is in SQL Server. In SQL Server the table is called "EMPLOYEE" but in
> Access
> it is called "SYSADM_EMPLOYEE".
>
> Thanks a lot,
> --
> Dan D.
>
>
> "Ken Snell (MVP)" wrote:
>
>> Try running the DLookup expression that you're using from the VBE
>> Immediate
>> Window... if an error exists, you'll get an error message from ACCESS:
>>
>> ?DLookUp("[EMP_CODE]","EMPLOYEE","[EMP_CODE] = 'ddonah' ")
>>
>> --
>>
>> Ken Snell
>> <MS ACCESS MVP>
>>
>>
>> "Dan D." <DanD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:7B64417D-8663-4DFD-8112-33E0FA381F58@xxxxxxxxxxxxxxxx
>> >I tried that but I still get the "#ERROR".
>> > --
>> > Dan D.
>> >
>> >
>> > "Ken Snell (MVP)" wrote:
>> >
>> >> Try removing the [ ] characters from around the table name:
>> >>
>> >> =DLookUp("[EMP_CODE]","EMPLOYEE","[EMP_CODE] = 'ddonah' ")
>> >>
>> >> I have found that ACCESS sometimes thinks the [ ] characters are part
>> >> of
>> >> the
>> >> table's name when there are no "non-letter" and "non-number"
>> >> characters
>> >> in
>> >> the name.
>> >> --
>> >>
>> >> Ken Snell
>> >> <MS ACCESS MVP>
>> >>
>> >>
>> >> "Dan D." <DanD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> >> news:8F634224-BBB5-4B2A-A2F9-E3EB4800C8E0@xxxxxxxxxxxxxxxx
>> >> > Yes, EMP_CODE is a text field. If you'll notice the query in my
>> >> > original
>> >> > post, there are single quotes around "nah". But even using single
>> >> > quotes,
>> >> > it
>> >> > doesn't work. I also tried it without single quotes.
>> >> >
>> >> > Thanks,
>> >> > --
>> >> > Dan D.
>> >> >
>> >> >
>> >> > "Ken Snell (MVP)" wrote:
>> >> >
>> >> >> Is EMP_CODE a text field? If yes, then the DLookup syntax you have
>> >> >> should
>> >> >> work. If it's a numeric field, lose the ' characters that
>> >> >> deliminate
>> >> >> ddonah
>> >> >> value.
>> >> >>
>> >> >> However, you state something about using variables from a form. A
>> >> >> report
>> >> >> cannot read the variables that a form is using unless those
>> >> >> variables
>> >> >> are
>> >> >> declared as Public in the Declarations section of the form's
>> >> >> module,
>> >> >> and
>> >> >> unless the form is open, and unless you refer to the variable as
>> >> >> Forms!FormName.VariableName
>> >> >>
>> >> >> --
>> >> >>
>> >> >> Ken Snell
>> >> >> <MS ACCESS MVP>
>> >> >>
>> >> >> "Dan D." <DanD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> >> >> news:73FBBE58-95E6-4C26-9411-CBA8803B5BE3@xxxxxxxxxxxxxxxx
>> >> >> > I'm trying to use dlookup in the control source of a text field
>> >> >> > in
>> >> >> > the
>> >> >> > header
>> >> >> > section
>> >> >> > of a report. If I used a query to get the result it would be
>> >> >> > this:
>> >> >> > select EMP_CODE from EMPLOYEE WHERE EMP_CODE = 'nah'
>> >> >> >
>> >> >> > The dlookup syntax that I'm using is this:
>> >> >> > =DLookUp("[EMP_CODE]","[EMPLOYEE]","[EMP_CODE] = 'ddonah' ")
>> >> >> >
>> >> >> > I get a "#error" when I run the report. This is just a test to
>> >> >> > see
>> >> >> > if I
>> >> >> > can
>> >> >> > get anything to show up on the report. Eventually
>> >> >> > I want to use a dlookup using variables that will come from a
>> >> >> > form.
>> >> >> > I
>> >> >> > don't
>> >> >> > know if it
>> >> >> > makes any differenct but the table that I'm trying to get the
>> >> >> > data
>> >> >> > from
>> >> >> > is
>> >> >> > not used
>> >> >> > anywhere else in the report.
>> >> >> >
>> >> >> > Thanks,
>> >> >> > --
>> >> >> > Dan D.
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>
.
- References:
- Re: dlookup problem
- From: Ken Snell \(MVP\)
- Re: dlookup problem
- From: Ken Snell \(MVP\)
- Re: dlookup problem
- From: Dan D.
- Re: dlookup problem
- From: Ken Snell \(MVP\)
- Re: dlookup problem
- From: Dan D.
- Re: dlookup problem
- Prev by Date: Re: dlookup problem
- Next by Date: Re: Expanding the Report Size ?
- Previous by thread: Re: dlookup problem
- Next by thread: Re: dlookup problem
- Index(es):
Relevant Pages
|