DLookUp Function

N

Nona

Can someone please tell me why the DlookUp function on two newly created
databases, using Acess 2000, no longer works. I have used this function
countless times to fill in the name of company branches. However, on two new
databases, the function doesn’t work, and I get an error message. The
expression I am trying to use on the report header is:

=DlookUp(“[UnitName]â€,â€[tblCostCtr]â€,â€[ID=636]â€

“Unit Name†is the field that contains the company names. “ID†is the field
that holds the numeric identity code. “TblCostCtr†is of course the name of
the table.I am baffled as to why this is not working and will appreciate your
help!
-
Nona
 
N

Nona

I wish I could say that one of the two suggestions so far worked, but neither
did. I eliminated all the brackets as Arvin suggested and placed the brackets
around ID as akphidelt suggested, but I got the same error message both times.
--
Nona


akphidelt said:
I think your problem is the brackets around [ID=636]

It should be "[ID]=636"

Nona said:
Can someone please tell me why the DlookUp function on two newly created
databases, using Acess 2000, no longer works. I have used this function
countless times to fill in the name of company branches. However, on two new
databases, the function doesn’t work, and I get an error message. The
expression I am trying to use on the report header is:

=DlookUp(“[UnitName]â€,â€[tblCostCtr]â€,â€[ID=636]â€

“Unit Name†is the field that contains the company names. “ID†is the field
that holds the numeric identity code. “TblCostCtr†is of course the name of
the table.I am baffled as to why this is not working and will appreciate your
help!
-
Nona
 
A

akphidelt

Well, make sure UnitName is actually UnitName and not Unit Name.

Check the table, if you are copying data from one table to the next,
sometimes a new ID field is generated with a new autonumber starting from 1.
If you check the table and the table name is tblCostCtr and the field name is
UnitName, and an ID set to a number that is 636, then I don't know what else
to tell you

Nona said:
I wish I could say that one of the two suggestions so far worked, but neither
did. I eliminated all the brackets as Arvin suggested and placed the brackets
around ID as akphidelt suggested, but I got the same error message both times.
--
Nona


akphidelt said:
I think your problem is the brackets around [ID=636]

It should be "[ID]=636"

Nona said:
Can someone please tell me why the DlookUp function on two newly created
databases, using Acess 2000, no longer works. I have used this function
countless times to fill in the name of company branches. However, on two new
databases, the function doesn’t work, and I get an error message. The
expression I am trying to use on the report header is:

=DlookUp(“[UnitName]â€,â€[tblCostCtr]â€,â€[ID=636]â€

“Unit Name†is the field that contains the company names. “ID†is the field
that holds the numeric identity code. “TblCostCtr†is of course the name of
the table.I am baffled as to why this is not working and will appreciate your
help!
-
Nona
 
N

Nona

Your suggestions are certainly on target but don't solve the problem. That's
why I'm so frustrated. It ought to work, but doesn't! "UnitName" is the field
- no spaces. And the ID is 636, not auto-generated.

--
Nona


akphidelt said:
Well, make sure UnitName is actually UnitName and not Unit Name.

Check the table, if you are copying data from one table to the next,
sometimes a new ID field is generated with a new autonumber starting from 1.
If you check the table and the table name is tblCostCtr and the field name is
UnitName, and an ID set to a number that is 636, then I don't know what else
to tell you

Nona said:
I wish I could say that one of the two suggestions so far worked, but neither
did. I eliminated all the brackets as Arvin suggested and placed the brackets
around ID as akphidelt suggested, but I got the same error message both times.
--
Nona


akphidelt said:
I think your problem is the brackets around [ID=636]

It should be "[ID]=636"

:

Can someone please tell me why the DlookUp function on two newly created
databases, using Acess 2000, no longer works. I have used this function
countless times to fill in the name of company branches. However, on two new
databases, the function doesn’t work, and I get an error message. The
expression I am trying to use on the report header is:

=DlookUp(“[UnitName]â€,â€[tblCostCtr]â€,â€[ID=636]â€

“Unit Name†is the field that contains the company names. “ID†is the field
that holds the numeric identity code. “TblCostCtr†is of course the name of
the table.I am baffled as to why this is not working and will appreciate your
help!
-
Nona
 
A

akphidelt

If it's not auto-generated is it set to Text?

Nona said:
Your suggestions are certainly on target but don't solve the problem. That's
why I'm so frustrated. It ought to work, but doesn't! "UnitName" is the field
- no spaces. And the ID is 636, not auto-generated.

--
Nona


akphidelt said:
Well, make sure UnitName is actually UnitName and not Unit Name.

Check the table, if you are copying data from one table to the next,
sometimes a new ID field is generated with a new autonumber starting from 1.
If you check the table and the table name is tblCostCtr and the field name is
UnitName, and an ID set to a number that is 636, then I don't know what else
to tell you

Nona said:
I wish I could say that one of the two suggestions so far worked, but neither
did. I eliminated all the brackets as Arvin suggested and placed the brackets
around ID as akphidelt suggested, but I got the same error message both times.
--
Nona


:

I think your problem is the brackets around [ID=636]

It should be "[ID]=636"

:

Can someone please tell me why the DlookUp function on two newly created
databases, using Acess 2000, no longer works. I have used this function
countless times to fill in the name of company branches. However, on two new
databases, the function doesn’t work, and I get an error message. The
expression I am trying to use on the report header is:

=DlookUp(“[UnitName]â€,â€[tblCostCtr]â€,â€[ID=636]â€

“Unit Name†is the field that contains the company names. “ID†is the field
that holds the numeric identity code. “TblCostCtr†is of course the name of
the table.I am baffled as to why this is not working and will appreciate your
help!
-
Nona
 
J

John W. Vinson

Your suggestions are certainly on target but don't solve the problem. That's
why I'm so frustrated. It ought to work, but doesn't! "UnitName" is the field
- no spaces. And the ID is 636, not auto-generated.

What is the Datatype of ID? If it's Text (even if it's numeric characters in a
Text field), you need the syntactially required quotemarks:

=DlookUp("UnitName","tblCostCtr","ID='636'")
 
N

Nona

Yes, it is text.

--
Nona


akphidelt said:
If it's not auto-generated is it set to Text?

Nona said:
Your suggestions are certainly on target but don't solve the problem. That's
why I'm so frustrated. It ought to work, but doesn't! "UnitName" is the field
- no spaces. And the ID is 636, not auto-generated.

--
Nona


akphidelt said:
Well, make sure UnitName is actually UnitName and not Unit Name.

Check the table, if you are copying data from one table to the next,
sometimes a new ID field is generated with a new autonumber starting from 1.
If you check the table and the table name is tblCostCtr and the field name is
UnitName, and an ID set to a number that is 636, then I don't know what else
to tell you

:

I wish I could say that one of the two suggestions so far worked, but neither
did. I eliminated all the brackets as Arvin suggested and placed the brackets
around ID as akphidelt suggested, but I got the same error message both times.
--
Nona


:

I think your problem is the brackets around [ID=636]

It should be "[ID]=636"

:

Can someone please tell me why the DlookUp function on two newly created
databases, using Acess 2000, no longer works. I have used this function
countless times to fill in the name of company branches. However, on two new
databases, the function doesn’t work, and I get an error message. The
expression I am trying to use on the report header is:

=DlookUp(“[UnitName]â€,â€[tblCostCtr]â€,â€[ID=636]â€

“Unit Name†is the field that contains the company names. “ID†is the field
that holds the numeric identity code. “TblCostCtr†is of course the name of
the table.I am baffled as to why this is not working and will appreciate your
help!
-
Nona
 
A

akphidelt

Ok, then that is why the Dlookup is not working... try

"[ID]='636'"

Make sure you include the ' before the last "

Nona said:
Yes, it is text.

--
Nona


akphidelt said:
If it's not auto-generated is it set to Text?

Nona said:
Your suggestions are certainly on target but don't solve the problem. That's
why I'm so frustrated. It ought to work, but doesn't! "UnitName" is the field
- no spaces. And the ID is 636, not auto-generated.

--
Nona


:

Well, make sure UnitName is actually UnitName and not Unit Name.

Check the table, if you are copying data from one table to the next,
sometimes a new ID field is generated with a new autonumber starting from 1.
If you check the table and the table name is tblCostCtr and the field name is
UnitName, and an ID set to a number that is 636, then I don't know what else
to tell you

:

I wish I could say that one of the two suggestions so far worked, but neither
did. I eliminated all the brackets as Arvin suggested and placed the brackets
around ID as akphidelt suggested, but I got the same error message both times.
--
Nona


:

I think your problem is the brackets around [ID=636]

It should be "[ID]=636"

:

Can someone please tell me why the DlookUp function on two newly created
databases, using Acess 2000, no longer works. I have used this function
countless times to fill in the name of company branches. However, on two new
databases, the function doesn’t work, and I get an error message. The
expression I am trying to use on the report header is:

=DlookUp(“[UnitName]â€,â€[tblCostCtr]â€,â€[ID=636]â€

“Unit Name†is the field that contains the company names. “ID†is the field
that holds the numeric identity code. “TblCostCtr†is of course the name of
the table.I am baffled as to why this is not working and will appreciate your
help!
-
Nona
 
N

Nona

WoW! Success! Thank You! The trick was the single mark around the code number
within the ID quotation marks. I've never done that the other times I've used
this function and it would never have occurred to me. Thank you very much!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top