473,385 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DLookup questions

JLM
What am I missing here?

I have a form where I enter a "Class Code". This value corresponds to what
sits in table "class code descriptions" along with the "title" of each
"class code." Key field is "class code."

I want a text box to be populated with the "title" which corresponds to the
"class code" which I enter in the form. The control source for the text box
is:

=DLookUp("[Title]","[class code descriptions]","[CCode] = forms![CCode]")
[this is literally what I have in the control source for the field.]

I get no value returned when I know that there is are corresponding values
in the table.

What am I missing here?

thanks in advance,
jlm
Nov 12 '05 #1
6 2311
On Wed, 18 Feb 2004 11:03:42 -0700, JLM wrote:
What am I missing here?

I have a form where I enter a "Class Code". This value corresponds to what
sits in table "class code descriptions" along with the "title" of each
"class code." Key field is "class code."

I want a text box to be populated with the "title" which corresponds to the
"class code" which I enter in the form. The control source for the text box
is:

=DLookUp("[Title]","[class code descriptions]","[CCode] = forms![CCode]")
[this is literally what I have in the control source for the field.]

I get no value returned when I know that there is are corresponding values
in the table.

What am I missing here?

thanks in advance,
jlm


Re: > Key field is "class code."
Is the Key Field "Class Code" or is it "CCode"?
If the field is actually named "CCode" and it is a Number Datatype,
then:

=DLookUp("[Title]","[class code descriptions]","[CCode] = " &
Me![CCode])

where [CCode] is the name of the control on the form that shows the
number to look up.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 12 '05 #2
JLM

"fredg" <fg******@att.net> wrote in message
news:tj****************************@40tude.net...
On Wed, 18 Feb 2004 11:03:42 -0700, JLM wrote:
What am I missing here?

I have a form where I enter a "Class Code". This value corresponds to what sits in table "class code descriptions" along with the "title" of each
"class code." Key field is "class code."

I want a text box to be populated with the "title" which corresponds to the "class code" which I enter in the form. The control source for the text box is:

=DLookUp("[Title]","[class code descriptions]","[CCode] = forms![CCode]") [this is literally what I have in the control source for the field.]

I get no value returned when I know that there is are corresponding values in the table.

What am I missing here?

thanks in advance,
jlm


Re: > Key field is "class code."
Is the Key Field "Class Code" or is it "CCode"?
If the field is actually named "CCode" and it is a Number Datatype,
then:

=DLookUp("[Title]","[class code descriptions]","[CCode] = " &
Me![CCode])

where [CCode] is the name of the control on the form that shows the
number to look up.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.


Key field is actually CCode and is text.
Nov 12 '05 #3
On Wed, 18 Feb 2004 11:57:27 -0700, JLM wrote:
"fredg" <fg******@att.net> wrote in message
news:tj****************************@40tude.net...
On Wed, 18 Feb 2004 11:03:42 -0700, JLM wrote:
What am I missing here?

I have a form where I enter a "Class Code". This value corresponds to what sits in table "class code descriptions" along with the "title" of each
"class code." Key field is "class code."

I want a text box to be populated with the "title" which corresponds to the "class code" which I enter in the form. The control source for the text box is:

=DLookUp("[Title]","[class code descriptions]","[CCode] = forms![CCode]") [this is literally what I have in the control source for the field.]

I get no value returned when I know that there is are corresponding values in the table.

What am I missing here?

thanks in advance,
jlm


Re: > Key field is "class code."
Is the Key Field "Class Code" or is it "CCode"?
If the field is actually named "CCode" and it is a Number Datatype,
then:

=DLookUp("[Title]","[class code descriptions]","[CCode] = " &
Me![CCode])

where [CCode] is the name of the control on the form that shows the
number to look up.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.


Key field is actually CCode and is text.

Then use:
=DLookUp("[Title]","[class code descriptions]","[CCode] = '" &
Me![CCode]) & "'")

With spaces addedd for clarity, the Where clause is:
"[CCode] = ' " & Me![CCode]) & " ' ")
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 12 '05 #4
JLM

"fredg" <fg******@att.net> wrote in message
news:mw***************************@40tude.net...
On Wed, 18 Feb 2004 11:57:27 -0700, JLM wrote:
"fredg" <fg******@att.net> wrote in message
news:tj****************************@40tude.net...
On Wed, 18 Feb 2004 11:03:42 -0700, JLM wrote:

What am I missing here?

I have a form where I enter a "Class Code". This value corresponds to

what
sits in table "class code descriptions" along with the "title" of each
"class code." Key field is "class code."

I want a text box to be populated with the "title" which corresponds
to the
"class code" which I enter in the form. The control source for the
text box
is:

=DLookUp("[Title]","[class code descriptions]","[CCode] =

forms![CCode]")
[this is literally what I have in the control source for the field.]

I get no value returned when I know that there is are corresponding

values
in the table.

What am I missing here?

thanks in advance,
jlm

Re: > Key field is "class code."
Is the Key Field "Class Code" or is it "CCode"?
If the field is actually named "CCode" and it is a Number Datatype,
then:

=DLookUp("[Title]","[class code descriptions]","[CCode] = " &
Me![CCode])

where [CCode] is the name of the control on the form that shows the
number to look up.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.


Key field is actually CCode and is text.

Then use:
=DLookUp("[Title]","[class code descriptions]","[CCode] = '" &
Me![CCode]) & "'")

With spaces addedd for clarity, the Where clause is:
"[CCode] = ' " & Me![CCode]) & " ' ")
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.


There must be something really wacked out because it won't work no matter
what I enter. This can't be that difficult. BTW, can you explain the "&"
symbols and the role they play?
thx
Nov 12 '05 #5
On Wed, 18 Feb 2004 15:15:44 -0700, JLM wrote:

** snipped **
Key field is actually CCode and is text.

Then use:
=DLookUp("[Title]","[class code descriptions]","[CCode] = '" &
Me![CCode]) & "'")

With spaces addedd for clarity, the Where clause is:
"[CCode] = ' " & Me![CCode]) & " ' ")
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.


There must be something really wacked out because it won't work no matter
what I enter. This can't be that difficult. BTW, can you explain the "&"
symbols and the role they play?
thx


1) Let me verbalize the above lookup and see if my using words can
explain what the code does. This way, if you see an error in my logic,
you can change a Field or table name.

= Get the data in the Field named [Title] located in the Table named
[class code descriptions] where the Field in that table named [CCode]
matches the control on this form named also named [CCode].
Note: [CCode] (as per your previous post) is Text datatype.

If it still doesn't work ....
Please state what you get (or don't get).
Is there an error given?
Please copy and paste the entire DLookUp you are using.
Please also give the EXACT table and field names in the table, as well
as the name of the control on the form that contains this DLookUp.

2) The & is used to concatenate strings (put them together), so that
if you write = "This is " & "a line of " & "Text", it would read
"This is a line of text".

In the where clause portion of the DLookUp above, Access will assemble
the clause like this, (assuming the value in the [CCode] control in
the form is "ABC123"):
"[CCode] ='ABC123' "
(I've separated the single and double quotes for clarity.)
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 12 '05 #6
JLM

"fredg" <fg******@att.net> wrote in message
news:au***************************@40tude.net...
On Wed, 18 Feb 2004 15:15:44 -0700, JLM wrote:

** snipped **
Key field is actually CCode and is text.
Then use:
=DLookUp("[Title]","[class code descriptions]","[CCode] = '" &
Me![CCode]) & "'")

With spaces addedd for clarity, the Where clause is:
"[CCode] = ' " & Me![CCode]) & " ' ")
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.


There must be something really wacked out because it won't work no matter what I enter. This can't be that difficult. BTW, can you explain the "&" symbols and the role they play?
thx


1) Let me verbalize the above lookup and see if my using words can
explain what the code does. This way, if you see an error in my logic,
you can change a Field or table name.

= Get the data in the Field named [Title] located in the Table named
[class code descriptions] where the Field in that table named [CCode]
matches the control on this form named also named [CCode].
Note: [CCode] (as per your previous post) is Text datatype.

If it still doesn't work ....
Please state what you get (or don't get).
Is there an error given?
Please copy and paste the entire DLookUp you are using.
Please also give the EXACT table and field names in the table, as well
as the name of the control on the form that contains this DLookUp.

2) The & is used to concatenate strings (put them together), so that
if you write = "This is " & "a line of " & "Text", it would read
"This is a line of text".

In the where clause portion of the DLookUp above, Access will assemble
the clause like this, (assuming the value in the [CCode] control in
the form is "ABC123"):
"[CCode] ='ABC123' "
(I've separated the single and double quotes for clarity.)
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.


From reading the online help sections of DLookup, I understand the logic of
the function. But for some reason, it isn't returning any data. Here are
the details of my situation.

Form: (I've modified it slightly since my last post. The changes are shown
here.) I created a Text Box called LookupTitle, on a form. In the Control
Source of this box I have, =DLookUp("[Title]","[class code
descriptions]","[CC] = ' " & Me!CC & " ' "). (Btw, I think your example had
an extra ")" in it.) With this in place, and when I look at the FormView,
the text box reads, #name?. When I enter a value in the CC field (which
will populate [TblEmp].[CC]), I expect to see LookupTitle filled with data.
(I didn't realize that "&" can be used in this instance. I use it all the
time in queries (which I guess is what I'm trying to do with DLookup).)

The form data source is a query that includes, among other things, the Class
Code and Title of each employee listed in that table. Fields CC and Title
on both tables have identical properties.

Table name: class code descriptions
fields: CC - text 6, Title - text 30.
record example: B2F2XX Budget Analyst II

Thanks for your patience in this. Let me know if I've omitted anything in
my description.
jlm
Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sue | last post by:
I sent an e-mail below and got a responese but i still have the #error message in the subject below: Can someone help me: questions and replies are separted by ----- -------My Questions: I have...
11
by: MLH | last post by:
DLookup("", "tblPreliminaryVINs", "=Forms!frmVINODO!SerialNum") is giving me a Type Mismatch error. That's confusing to me and I don't know how to circumvent it. The field in...
4
by: Karen Bielska | last post by:
I have a table "Customer" with two fields "CusID" (autonumber, PK) and "CusName" (text). If I know the customer's ID, say 215, how can I find the name using DLookup? PS: I'm not really looking...
2
by: Don | last post by:
Can someone help me fix my DLookup problem. I'm far from proficiency with Access. I've been creating databases for several years for work with the help of many of you and trial and error. I have...
12
by: AricC | last post by:
Howdy Errrrbody, I'm new here! I have a few questions that I can't seem to get answered, maybe you all can help. I am writing an access program ( first time I'm accustomed to .Net + Sql Server...
2
by: alphaomega3 | last post by:
I need to know is it possible to do a DLookup to two different Tables provided a checkbox is checked. The example will be if checkbox1 is checked then Dlookup Data in table1 or if Checkbox2 is...
5
by: hrreece | last post by:
I have a form, Master List Temp, in Access 2003 that uses the Dlookup command to pull values from another table, Address Master. The user types in a person's home phone number in the HomePhone field...
9
by: | last post by:
In my database I have a 'control table' in which basic info is stored about the application, for instance the application's path and the name of the company that is using it. In all of the...
15
by: rleepac | last post by:
This is a little complicated but I'll do my best to explain. In my db I have a table called L_AgeCorrection which has the following fields: Age, Sex, Frequency, AgeValue This is a table used to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.