I have a MS Access 2002 form which basically provides text boxes to manipulate records in a table called Materials. I also have another table called MaterialCosting which has a column MaterialID which links it to the Materials table which also has a column MaterialID. What I am trying to do is to add a text box to this form which reads and writes to a field of MaterialCosting named outerCarton.
Here are my failed attempts:
- Right click on the form, Choose properties, and in data->Record source, enter an SQL query that joins the two tables (
SELECT * FROM Materials AS M INNER JOIN MaterialCosting AS C ON C.MaterialID = M.MaterialID). Then simply put the name of the required column (outerCarton) in the text box's control source. - In the text box's control source, put
DLookup("[outerCarton]", "[MaterialCosting]", "MaterialCosting.MaterialID = Materials.MaterialID")
Both of these had the same result: the text box would end up with #Name? in it and do nothing.
How can I make this work?
UPDATE
The form's properties
The control's properties


MaterialCosting. – Shawn Feb 10 at 19:25outerCartonas the Record Source? If the tables are already linked as you say, you should be able to use it without putting a query in the text box. – CharlieRB Feb 10 at 19:51outerCartonas the Record Source is what I do in #1. I edited it to add the SQL I use for that as well. It results in the field having#Name?in it. – Shawn Feb 10 at 20:25