DLookup

  • Thread starter Thread starter NEC-2008
  • Start date Start date
N

NEC-2008

I have a text box on a form whoes "default value" is
=DLookup("[tbl_PreFixNumber_A]![PerFixNumber_A]","tbl_PreFixNumber_A","[tbl_PreFixNumber_A]![PreFixID_A]=1")

tbl_PreFixNumber

Field Name Data Type
PreFixID_A AutoNumber
PreFixNumber_A Text

Question: Why do I keep getting the "#Error" in the text box on the form.

Thanks in advance for the help
 
I believe your syntax is wrong.

Try:

=DLookup("[PerFixNumber_A]","tbl_PreFixNumber_A","[PreFixID_A]=1")
 
Mr. Steele, Tried this and there was still no change.

Douglas J. Steele said:
I believe your syntax is wrong.

Try:

=DLookup("[PerFixNumber_A]","tbl_PreFixNumber_A","[PreFixID_A]=1")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


NEC-2008 said:
I have a text box on a form whoes "default value" is
=DLookup("[tbl_PreFixNumber_A]![PerFixNumber_A]","tbl_PreFixNumber_A","[tbl_PreFixNumber_A]![PreFixID_A]=1")

tbl_PreFixNumber

Field Name Data Type
PreFixID_A AutoNumber
PreFixNumber_A Text

Question: Why do I keep getting the "#Error" in the text box on the
form.

Thanks in advance for the help
 
Make certain you haven't mistyped any of the names.

Also, if PreFixID_A is defined as a text field, you'll need to put quotes
around the value:

=DLookup("[PerFixNumber_A]","tbl_PreFixNumber_A","[PreFixID_A]='1' ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


NEC-2008 said:
Mr. Steele, Tried this and there was still no change.

Douglas J. Steele said:
I believe your syntax is wrong.

Try:

=DLookup("[PerFixNumber_A]","tbl_PreFixNumber_A","[PreFixID_A]=1")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


NEC-2008 said:
I have a text box on a form whoes "default value" is
=DLookup("[tbl_PreFixNumber_A]![PerFixNumber_A]","tbl_PreFixNumber_A","[tbl_PreFixNumber_A]![PreFixID_A]=1")

tbl_PreFixNumber

Field Name Data Type
PreFixID_A AutoNumber
PreFixNumber_A Text

Question: Why do I keep getting the "#Error" in the text box on the
form.

Thanks in advance for the help
 
The value I need on the form is getting into the table via the form for that
purpose.
All the spelling is correct. Are there any other switches that need to be
turned ( on / off) to make the dlookup work.
The "PreFixID_A" is defined as an autonumber field and not a text field.
OK>>>I'll try some other variations of this and see if that works. Have to
go out...will be back on 7/6. Thanks for the input.

Douglas J. Steele said:
Make certain you haven't mistyped any of the names.

Also, if PreFixID_A is defined as a text field, you'll need to put quotes
around the value:

=DLookup("[PerFixNumber_A]","tbl_PreFixNumber_A","[PreFixID_A]='1' ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


NEC-2008 said:
Mr. Steele, Tried this and there was still no change.

Douglas J. Steele said:
I believe your syntax is wrong.

Try:

=DLookup("[PerFixNumber_A]","tbl_PreFixNumber_A","[PreFixID_A]=1")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have a text box on a form whoes "default value" is
=DLookup("[tbl_PreFixNumber_A]![PerFixNumber_A]","tbl_PreFixNumber_A","[tbl_PreFixNumber_A]![PreFixID_A]=1")

tbl_PreFixNumber

Field Name Data Type
PreFixID_A AutoNumber
PreFixNumber_A Text

Question: Why do I keep getting the "#Error" in the text box on the
form.

Thanks in advance for the help
 
Try taking the value outside of the quotes ...

=DLookup("[PerFixNumber_A]","tbl_PreFixNumber_A","[PreFixID_A]" = 1)

NEC-2008 said:
The value I need on the form is getting into the table via the form for that
purpose.
All the spelling is correct. Are there any other switches that need to be
turned ( on / off) to make the dlookup work.
The "PreFixID_A" is defined as an autonumber field and not a text field.
OK>>>I'll try some other variations of this and see if that works. Have to
go out...will be back on 7/6. Thanks for the input.

Douglas J. Steele said:
Make certain you haven't mistyped any of the names.

Also, if PreFixID_A is defined as a text field, you'll need to put quotes
around the value:

=DLookup("[PerFixNumber_A]","tbl_PreFixNumber_A","[PreFixID_A]='1' ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


NEC-2008 said:
Mr. Steele, Tried this and there was still no change.

:

I believe your syntax is wrong.

Try:

=DLookup("[PerFixNumber_A]","tbl_PreFixNumber_A","[PreFixID_A]=1")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have a text box on a form whoes "default value" is
=DLookup("[tbl_PreFixNumber_A]![PerFixNumber_A]","tbl_PreFixNumber_A","[tbl_PreFixNumber_A]![PreFixID_A]=1")

tbl_PreFixNumber

Field Name Data Type
PreFixID_A AutoNumber
PreFixNumber_A Text

Question: Why do I keep getting the "#Error" in the text box on the
form.

Thanks in advance for the help
 
OK....I'll do that and get back to you. Thanks

Bob Gajewski said:
Try taking the value outside of the quotes ...

=DLookup("[PerFixNumber_A]","tbl_PreFixNumber_A","[PreFixID_A]" = 1)

NEC-2008 said:
The value I need on the form is getting into the table via the form for that
purpose.
All the spelling is correct. Are there any other switches that need to be
turned ( on / off) to make the dlookup work.
The "PreFixID_A" is defined as an autonumber field and not a text field.
OK>>>I'll try some other variations of this and see if that works. Have to
go out...will be back on 7/6. Thanks for the input.

Douglas J. Steele said:
Make certain you haven't mistyped any of the names.

Also, if PreFixID_A is defined as a text field, you'll need to put quotes
around the value:

=DLookup("[PerFixNumber_A]","tbl_PreFixNumber_A","[PreFixID_A]='1' ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Mr. Steele, Tried this and there was still no change.

:

I believe your syntax is wrong.

Try:

=DLookup("[PerFixNumber_A]","tbl_PreFixNumber_A","[PreFixID_A]=1")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have a text box on a form whoes "default value" is
=DLookup("[tbl_PreFixNumber_A]![PerFixNumber_A]","tbl_PreFixNumber_A","[tbl_PreFixNumber_A]![PreFixID_A]=1")

tbl_PreFixNumber

Field Name Data Type
PreFixID_A AutoNumber
PreFixNumber_A Text

Question: Why do I keep getting the "#Error" in the text box on the
form.

Thanks in advance for the help
 
Back
Top