dlookup insanity ... #ERROR without explanation

  • Thread starter Thread starter stebro
  • Start date Start date
S

stebro

I have a form named Testcase Summary which accesses the
Testcase_Summary database. I have a separate table I
want to use as a lookup table to convert a code from the
database to a description. Easy, right?

In the form there is a textbox that I want the
description to appear in. For the Control_Source I have
the following statement:

=DLookUp
("[test_phase_description]", "[lkup_test_phase_description
]", "[test_phase_id] = " & [ts_test_phase_id])

Where test_phase_description is the description I want
returned, and lkup_test_phase_description is the lookup
table, and test_phase_id is the field being searched on
the lookup table, and ts_test_phase_id is the code I am
passing to the lookup table from the Testcase_Summary
database.

The result is the #ERROR messaage when I run the form. I
have tried everything I can think of but cannot figure
out how to debug this. Everything looks exactly as in
the textbook.

Any help?

Thanks -
Steve
 
I have a form named Testcase Summary which accesses the
Testcase_Summary database. I have a separate table I
want to use as a lookup table to convert a code from the
database to a description. Easy, right?

In the form there is a textbox that I want the
description to appear in. For the Control_Source I have
the following statement:

=DLookUp
("[test_phase_description]", "[lkup_test_phase_description
]", "[test_phase_id] = " & [ts_test_phase_id])

Where test_phase_description is the description I want
returned, and lkup_test_phase_description is the lookup
table, and test_phase_id is the field being searched on
the lookup table, and ts_test_phase_id is the code I am
passing to the lookup table from the Testcase_Summary
database.

The result is the #ERROR messaage when I run the form. I
have tried everything I can think of but cannot figure
out how to debug this. Everything looks exactly as in
the textbook.

Any help?

Thanks -
Steve

Make sure the name of this control is not the same as any field used
in the expression.
Also, your where clause indicates that [Test_Phase_ID] is a number
datatype. If it is text datatype, then use:
"[test_phase_id] = '" & [ts_test_phase_id] & "'")
 
I don't think you need the [] around the table name.

If [ts_test_phase_id] is numeric :
=DLookUp ("[test_phase_description]", "lkup_test_phase_description", "[test_phase_id] = " & [ts_test_phase_id])

If [ts_test_phase_id] is text :
=DLookUp ("[test_phase_description]", "lkup_test_phase_description", "[test_phase_id] = ' " & [ts_test_phase_id] & " ' ")

HTH,
Debbie


|I have a form named Testcase Summary which accesses the
| Testcase_Summary database. I have a separate table I
| want to use as a lookup table to convert a code from the
| database to a description. Easy, right?
|
| In the form there is a textbox that I want the
| description to appear in. For the Control_Source I have
| the following statement:
|
| =DLookUp
| ("[test_phase_description]", "[lkup_test_phase_description
| ]", "[test_phase_id] = " & [ts_test_phase_id])
|
| Where test_phase_description is the description I want
| returned, and lkup_test_phase_description is the lookup
| table, and test_phase_id is the field being searched on
| the lookup table, and ts_test_phase_id is the code I am
| passing to the lookup table from the Testcase_Summary
| database.
|
| The result is the #ERROR messaage when I run the form. I
| have tried everything I can think of but cannot figure
| out how to debug this. Everything looks exactly as in
| the textbook.
|
| Any help?
|
| Thanks -
| Steve
 
The solution was simply the quote marks indicating that
ts_test_phase_id is a text field.

The solution works with the brackets - I saw may examples
use them. I haven't tried it without the brackets.

Thanks to you both!
Steve

-----Original Message-----
I don't think you need the [] around the table name.

If [ts_test_phase_id] is numeric :
=DLookUp
("[test_phase_description]", "lkup_test_phase_description"
, "[test_phase_id] = " & [ts_test_phase_id])
If [ts_test_phase_id] is text :
=DLookUp
("[test_phase_description]", "lkup_test_phase_description"
, "[test_phase_id] = ' " & [ts_test_phase_id] & " ' ")
HTH,
Debbie


"stebro" <[email protected]> wrote in
message news:[email protected]...
|I have a form named Testcase Summary which accesses the
| Testcase_Summary database. I have a separate table I
| want to use as a lookup table to convert a code from the
| database to a description. Easy, right?
|
| In the form there is a textbox that I want the
| description to appear in. For the Control_Source I have
| the following statement:
|
| =DLookUp
|
("[test_phase_description]", "[lkup_test_phase_description
| ]", "[test_phase_id] = " & [ts_test_phase_id])
|
| Where test_phase_description is the description I want
| returned, and lkup_test_phase_description is the lookup
| table, and test_phase_id is the field being searched on
| the lookup table, and ts_test_phase_id is the code I am
| passing to the lookup table from the Testcase_Summary
| database.
|
| The result is the #ERROR messaage when I run the form. I
| have tried everything I can think of but cannot figure
| out how to debug this. Everything looks exactly as in
| the textbook.
|
| Any help?
|
| Thanks -
| Steve


.
 
Back
Top