How do I reference a value on a query on a form is not sourced from the same query?

ST4RCUTTER

Registered User.
Local time
Today, 10:44
Joined
Aug 31, 2006
Messages
94
I am trying to avoid using the DLOOKUP function due to the impacts it has on performance (load times). This is especially prevalent on a not-so-fast-network connection. I have a form based off a query that itself is sourced from a table of work orders. There is another table that houses contact referenceID's which is related to the table of work orders. There is then a reference table of names that correspond to the referencID's on the table of contacts. Here is how it looks:


*Work Order Tbl...........*Contacts Tbl....................*Contact Reference Tbl
WorkOrderID (PK)-------WorkOrderID
Project Status..............ContactID(FK)---------------ContactID(PK)
Project type.........................................................Contact Type
Project Name.......................................................Contact FirstName



I created a query that shows the Lastname of the contact of a specific Contact Type related to the WorkOrder. When I try to show the value of this field on the Form I just get #Name?. How do I refer to a field on a query that is not the source of the current form? Thanks!
 
(it would be helpful if you posted the code for your query.- also, i'm not exaclty sure from your description what you're using where in terms of tables/queries on the form)

i had a similar problem with the #Name? showing. my control source had 7 columns, but i was telling access to 'count' (use) only the first two. once i changed the 'column count' in the properties of the listbox i was trying to get my value from it started to work!
 
How do I refer to a field on a query that is not the source of the current form?
You need to either:

1. Include it in the form's recordsource.

2. Use a DLookup to assign it.

3. Use code to open a recordset and then assign the value to the control.
 

Users who are viewing this thread

Back
Top Bottom