display a field in a form which isnt in the record source of the f

M

Martin

i created a "warehouse" form, from where the user can add records to the
"warehouse" table. in the form the user can select the date, the component
type (via a combo box) and the user can type in the inflow or ouflow amount.
at the bottom of the "warehouse" form i placed a button which adds the
information to the "warehouse" table. everything is working fine so far,
except that i am trying to add a text box to the form which shows the current
amount of the selected component type (this text box is based on a query
which calculated the current amount of all component types in the warehouse).
i already tried using a Dlockup function in the control source of the textbox
(=DLookUp(" [current amount] "," Query![current stock] "," [component type] =
& Form![ware
house]![cboct]")), but it doesnt work. Can someone bring me on the right
track?
 
R

RonaldoOneNil

If the component type is a numeric field then use

=DLookUp("[current amount]","current stock","[component type] = " &
Me.[cboct])

If the component type is a text field then use

=DLookUp("[current amount]","current stock","[component type] = '" &
Me.[cboct] & "'")
 

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