link query field to form field?

DaniBoy

Registered User.
Local time
Today, 09:58
Joined
Nov 18, 2001
Messages
174
Hello,
I have a query that gets the average cost of a product from all invoices, noe I have a form created from the table Products, in this form I have an "unbound" field where I want the value of the average cost from the query to be display. How do I link the value on the query to the unbound field on the form?

Thanks

DaniBoy
 
Did I explain my self ok?

Let me try to explain this better, I have a form Products with the fields pProductID, pName, and an unbound field.

The unbound field I need it to be likned to a query just like when you link the Total from a sub-form to the main form that goes like this:
=[OrderDetail Subform].Form![Gran Total]

Thanks

DaniBoy
 
Rather than basing the form on your table, create a query that will give you desired result (ie: you average) and then base your form on your new query.

Your records will not be updatable, but a calculated value is exactly that, calculated (not entered).

HTH

Brad.

** edit **

I re-read your first post. If you already have the query producing the results, then you are halfway there. Base the form on the query, not the table

********
 
Thanks Brad!! Still problem

If I do that then I cant add a new record, I tried it by doing a query with the table products and the query AverageCost it works fine just to show records but I cant add records.

Any susgestions?

DaniBoy
I hope you still there!! I cant sleep trying this!!!
 
Thanks Pat

I did the lookup but I still get the name error!! I put the code on the afterupdate event right? and the code should look like what? maybe am doing it wrong!!

Thanks
DaniBoy
 

Users who are viewing this thread

Back
Top Bottom