PC Review


Reply
Thread Tools Rate Thread

DLookUp Stressed Out

 
 
=?Utf-8?B?SmVu?=
Guest
Posts: n/a
 
      23rd Mar 2006
Okay I used this function many times and it works every other place but this
one path will not work...

Main table is = TblEmployess [TEEmployeeID] [TELastName]

Table receiving information is = TblLogInSheet [TblEmployeeID] "I should
have named it [TEEmployeeID]

Now I want to look the last name up when I enter the Employee ID I tried
=DLookUp("[TblEmployeeID]","[TblLogInSheet]","[TEEmployeeID]=" & [TELastName])

It does not work.......HELP PLEASE........

Thanks
 
Reply With Quote
 
 
 
 
Dirk Goldgar
Guest
Posts: n/a
 
      23rd Mar 2006
"Jen" <(E-Mail Removed)> wrote in message
news:82F1AFD8-9439-462A-9894-(E-Mail Removed)
> Okay I used this function many times and it works every other place
> but this one path will not work...
>
> Main table is = TblEmployess [TEEmployeeID] [TELastName]
>
> Table receiving information is = TblLogInSheet [TblEmployeeID] "I
> should
> have named it [TEEmployeeID]
>
> Now I want to look the last name up when I enter the Employee ID I
> tried =DLookUp("[TblEmployeeID]","[TblLogInSheet]","[TEEmployeeID]="
> & [TELastName])


You seem to be asking for records where TEEmployeeID, which I would
guess doesn't contain names, is equal to an employee's last name. Also,
your DLookup expression is looking up an EmployeeID given a last name,
but that's not what you said you wanted; you said you want to look up a
last name, given an Employee ID. If what you said is what you want,
then this would be more like it:

=DLookUp("TELastName","TblEmployees",
"TEEmployeeID=" & [TblEmployeeID])

That says, "look in TblEmployees for the record that has TEEmployeeID
equal to [TblEmployeeID], and return the value of TELastName for that
record. Is that what you want?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
 
=?Utf-8?B?QW5kcmV3IFRhcHA=?=
Guest
Posts: n/a
 
      23rd Mar 2006
You say you want to look up the last name, however the DLookUp seems to be
looking up the field [TblEmployeeID] from table [TblLogInSheet] for
[TEEmployeeID] = [TELastName].

I think you should be coding along the lines of:
=DLookUp("[TELastName]","[TblEmployess]","[TEEmployeeID]=" & [Employee ID])
Where [Employee ID] is the field you entered and want to look up.

Note that if [TEEmployeeID] is as text field (as opposed to a number) you
should use:
=DLookUp("[TELastName]","[TblEmployess]","[TEEmployeeID]='" & [Employee ID]
& "'")

Note the single quotes around [Employee ID].

Hope this helps.

"Jen" wrote:

> Okay I used this function many times and it works every other place but this
> one path will not work...
>
> Main table is = TblEmployess [TEEmployeeID] [TELastName]
>
> Table receiving information is = TblLogInSheet [TblEmployeeID] "I should
> have named it [TEEmployeeID]
>
> Now I want to look the last name up when I enter the Employee ID I tried
> =DLookUp("[TblEmployeeID]","[TblLogInSheet]","[TEEmployeeID]=" & [TELastName])
>
> It does not work.......HELP PLEASE........
>
> Thanks

 
Reply With Quote
 
=?Utf-8?B?TWFydGlu?=
Guest
Posts: n/a
 
      23rd Mar 2006
I think it should be:

=Dlookup(“TblEmployeeID”, “TblEmployees”, “TEEmployeeID=TblEmployeeID”)

"Jen" wrote:

> Okay I used this function many times and it works every other place but this
> one path will not work...
>
> Main table is = TblEmployess [TEEmployeeID] [TELastName]
>
> Table receiving information is = TblLogInSheet [TblEmployeeID] "I should
> have named it [TEEmployeeID]
>
> Now I want to look the last name up when I enter the Employee ID I tried
> =DLookUp("[TblEmployeeID]","[TblLogInSheet]","[TEEmployeeID]=" & [TELastName])
>
> It does not work.......HELP PLEASE........
>
> Thanks

 
Reply With Quote
 
=?Utf-8?B?SmVu?=
Guest
Posts: n/a
 
      23rd Mar 2006
Okay now when I type in either of your formats I get the following error

#name?

istead of just the #error.....


"Andrew Tapp" wrote:

> You say you want to look up the last name, however the DLookUp seems to be
> looking up the field [TblEmployeeID] from table [TblLogInSheet] for
> [TEEmployeeID] = [TELastName].
>
> I think you should be coding along the lines of:
> =DLookUp("[TELastName]","[TblEmployess]","[TEEmployeeID]=" & [Employee ID])
> Where [Employee ID] is the field you entered and want to look up.
>
> Note that if [TEEmployeeID] is as text field (as opposed to a number) you
> should use:
> =DLookUp("[TELastName]","[TblEmployess]","[TEEmployeeID]='" & [Employee ID]
> & "'")
>
> Note the single quotes around [Employee ID].
>
> Hope this helps.
>
> "Jen" wrote:
>
> > Okay I used this function many times and it works every other place but this
> > one path will not work...
> >
> > Main table is = TblEmployess [TEEmployeeID] [TELastName]
> >
> > Table receiving information is = TblLogInSheet [TblEmployeeID] "I should
> > have named it [TEEmployeeID]
> >
> > Now I want to look the last name up when I enter the Employee ID I tried
> > =DLookUp("[TblEmployeeID]","[TblLogInSheet]","[TEEmployeeID]=" & [TELastName])
> >
> > It does not work.......HELP PLEASE........
> >
> > Thanks

 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      23rd Mar 2006
"Jen" <(E-Mail Removed)> wrote in message
news:5C7A3E55-E764-48BF-A55F-(E-Mail Removed)
> Okay now when I type in either of your formats I get the following
> error
>
> #name?
>
> istead of just the #error.....


Where is the DLookup expression being placed? In the ControlSource of a
text box on a form? That text box must not have the same name as any
field in the form's recordsource. If it does, rename the text box,
maybe by prefixing the name with "txt".

Another possible source of this error: you're getting the ID value to
lookup from some other control on the form. In my example, I guessed
the name of that control was "TblEmployeeID". Is that the actual name
of the control on your form? If not, replace "TblEmployeeID" in the
DLookup expression with the correct name of the control.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
 
=?Utf-8?B?SmVu?=
Guest
Posts: n/a
 
      23rd Mar 2006
This is exactly what I want but when I put the code in it returns with:

#error....

That says, "look in TblEmployees for the record that has TEEmployeeID
equal to [TblEmployeeID], and return the value of TELastName for that
record. Is that what you want?

"Dirk Goldgar" wrote:

> "Jen" <(E-Mail Removed)> wrote in message
> news:82F1AFD8-9439-462A-9894-(E-Mail Removed)
> > Okay I used this function many times and it works every other place
> > but this one path will not work...
> >
> > Main table is = TblEmployess [TEEmployeeID] [TELastName]
> >
> > Table receiving information is = TblLogInSheet [TblEmployeeID] "I
> > should
> > have named it [TEEmployeeID]
> >
> > Now I want to look the last name up when I enter the Employee ID I
> > tried =DLookUp("[TblEmployeeID]","[TblLogInSheet]","[TEEmployeeID]="
> > & [TELastName])

>
> You seem to be asking for records where TEEmployeeID, which I would
> guess doesn't contain names, is equal to an employee's last name. Also,
> your DLookup expression is looking up an EmployeeID given a last name,
> but that's not what you said you wanted; you said you want to look up a
> last name, given an Employee ID. If what you said is what you want,
> then this would be more like it:
>
> =DLookUp("TELastName","TblEmployees",
> "TEEmployeeID=" & [TblEmployeeID])
>
> That says, "look in TblEmployees for the record that has TEEmployeeID
> equal to [TblEmployeeID], and return the value of TELastName for that
> record. Is that what you want?
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
please help me im getting stressed!! =?Utf-8?B?Z2VtZWxhMjQ=?= Windows Vista Performance 0 18th Jul 2007 11:02 AM
How do I mark stressed and unstressed syllables in poetry? =?Utf-8?B?YXphbGVl?= Microsoft Word Document Management 1 18th Nov 2005 05:07 PM
stressed not dot calm - anti RSI software savik Freeware 3 13th Nov 2005 07:43 PM
Very Stressed about Cascading Combo Boxes =?Utf-8?B?S2F0ZUFjY2Vzcw==?= Microsoft Access Getting Started 2 13th Apr 2005 06:41 PM
be thankful for help, you stressed out,ingrateful for help, computer users sirena Windows XP Print / Fax 0 18th Aug 2004 04:59 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:44 PM.