-Operating in MS Access 2003-
On a Form, I have a Text Box (txtName) that is populated with a name selected from an unbound List Box.
I would like a separate Text Box (txtReport) to perform a DLookUp to return a value from a table based on the string displayed in txtName.
DLookUp(Field, Table, Criteria)
Field: REPORT_TITLE
Table: Incentive_TEAM_NAME
- Two columns of interest in this table: REPORT_TITLE & TEAM_NAME
Criteria: txtName = TEAM_NAME
Ideally, txtReport will display the value in "REPORT_TITLE" that is in the same row in the table 'Incentive_TEAM_NAME' as the value in "TEAM_NAME".
ex: in the Incentive_TEAM_NAME table...
Entering the following in the Control Source of txtReport results in a #Name? error:
I am not sure where the problem lies...perhaps a misplaced quotation mark? Am I entering this formula in the wrong section of the txtReport properties?
I am very new to Access, any help at all would be much appreciated.
Thanks in advance.
On a Form, I have a Text Box (txtName) that is populated with a name selected from an unbound List Box.
I would like a separate Text Box (txtReport) to perform a DLookUp to return a value from a table based on the string displayed in txtName.
DLookUp(Field, Table, Criteria)
Field: REPORT_TITLE
Table: Incentive_TEAM_NAME
- Two columns of interest in this table: REPORT_TITLE & TEAM_NAME
Criteria: txtName = TEAM_NAME
Ideally, txtReport will display the value in "REPORT_TITLE" that is in the same row in the table 'Incentive_TEAM_NAME' as the value in "TEAM_NAME".
ex: in the Incentive_TEAM_NAME table...
TEAM_NAME| |REPORT_TITLE
Jones/Smith| |Jones-Smith
Jones/Smith| |Jones-Smith
Within the List Box, the user will have selected Jones/Smith. Jones/Smith will display in the txtName Text Box. The use of the DLookUp in txtReport will allow the Text Box to display Jones-Smith.
Entering the following in the Control Source of txtReport results in a #Name? error:
Code:
=DLookUp("Incentive_TEAM_NAME!REPORT_TITLE","Incentive_TEAM_NAME"," [ " & me.txtName & " ] " & " = 'Incentive_TEAM_NAME![TEAM_NAME]'")
I am not sure where the problem lies...perhaps a misplaced quotation mark? Am I entering this formula in the wrong section of the txtReport properties?
I am very new to Access, any help at all would be much appreciated.
Thanks in advance.