does a querry update a table

B

Bob H

I have just created another querry in my database, which has currency
values of parts which have been shipped. Previously I didn't have this
querry, but now I do, and I have noticed that the value which is in the
said querry feild does not update the main table I have.
In reality I suppose it can't at the moment, so how do I get this to happen.
To build the querry I added feilds from the main table and feilds from a
newly created table by using INNER JOIN to get the a calculation of data.
It is this calculated dated I want to go in a feild in the main form.

Thanks
 
M

Marshall Barton

Bob said:
I have just created another querry in my database, which has currency
values of parts which have been shipped. Previously I didn't have this
querry, but now I do, and I have noticed that the value which is in the
said querry feild does not update the main table I have.
In reality I suppose it can't at the moment, so how do I get this to happen.
To build the querry I added feilds from the main table and feilds from a
newly created table by using INNER JOIN to get the a calculation of data.
It is this calculated dated I want to go in a feild in the main form.

Unless users can edit the calculated value, you should
almost never save a calculated value. Instead, just use
your query as the form's record source or move the
calculation to a text box expression in the form.
 
B

Bob H

Marshall said:
Unless users can edit the calculated value, you should
almost never save a calculated value. Instead, just use
your query as the form's record source or move the
calculation to a text box expression in the form.

The data which has been calculated by the querry is needed in a text box
on a main form, but the said main form uses data from another table as
its recordsource, and I cannot get the said text box to use the
calculated data in the new querry as its recordsource.

Thanks
 
R

Ragefury

The data which has been calculated by the querry is needed in a text box
on a main form, but the said main form uses data from another table as
its recordsource, and I cannot get the said text box to use the
calculated data in the new querry as its recordsource.

Thanks- Hide quoted text -

- Show quoted text -

Why not set the textbox value dynamically, you need not use bound
controls. Using unbound controls adds more flexibility in my opinion.
 
J

John W. Vinson

I have added an unbound textbox, and then tried to add an expression
which points to the feild in the querry, but it doesn't work or show any
value.

Well... your expression was incorrect.

If you would like help fixing it please post the expression that you used.
 
B

Bob H

John said:
Well... your expression was incorrect.

If you would like help fixing it please post the expression that you used.

Ok thanks for that, so here is the expression from Expression Builder:
= [qryPartValue]![CommercialValue]

CommercialValue is a feild in the querry and also a textbox on the main
form,which is taken from the same feild on the main table.

Thanks
 
J

John W. Vinson

John said:
Well... your expression was incorrect.

If you would like help fixing it please post the expression that you used.

Ok thanks for that, so here is the expression from Expression Builder:
= [qryPartValue]![CommercialValue]

CommercialValue is a feild in the querry and also a textbox on the main
form,which is taken from the same feild on the main table.

Thanks

You can't just reference a query in that manner. Either use

=Parent![CommercialValue]

to directly read the textbox from the main form, or

=DLookUp("[CommercialValue]", "[qryPartValue]", <criteria to select the
desired part>)
 
B

Bob H

John said:
John said:
I have added an unbound textbox, and then tried to add an expression
which points to the feild in the querry, but it doesn't work or show any
value.
Well... your expression was incorrect.

If you would like help fixing it please post the expression that you used.
Ok thanks for that, so here is the expression from Expression Builder:
= [qryPartValue]![CommercialValue]

CommercialValue is a feild in the querry and also a textbox on the main
form,which is taken from the same feild on the main table.

Thanks

You can't just reference a query in that manner. Either use

=Parent![CommercialValue]

Adding this as a Controlsource in form design view for the said text
box, produces an #Error
to directly read the textbox from the main form, or

=DLookUp("[CommercialValue]", "[qryPartValue]", <criteria to select the
desired part>)

Adding this to the ControlSource in form design view for the commercial
value text box puts the same value in every record in the main form,
which is the first value from the qryPartValue

I have also tried adding the relevant qurries in querry design, but I am
not getting the results I want. Maybe I amnot adding the corrct tables
or qurries??

I have tblShipping_Control, the main table
tblValues, Values of the parts to ship from 3 sites
tblValueTees, Values of parts from another site
tblPart, listing every part which needs a value
qryPartValue, from tblValues
qryValueTees, from tblValueTees
qryShipping_Control, main qry
frmShipping_Control, main form with all required fields including
Commercial Value, CargoQty, and CargoDescription.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top