How can I get a text box sourced by a query to sync with its form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subform that executes a query and MS access syncs it with its main
form's key fields. How can I do the same thing using a text box on the main
form? I get the dreaded #name? when I do the latter, yet the sub form works
fine. I do not need all the record processing that a subform gives you.
 
Your question is very vague...
A WAG suggests you might be able to use a list or combo box. DLookup() might
also work.
 
Hi,
Thanks for your reply.

I will expand in case you may want to provide further thoughts.

I have a quantiy field on an item in an inventory table. I have activity
for that item in an activity table. On my main inventory form I have a
subform that uses query to show all the displayed item's activity
transactions(mostly sold transactions). On my main inventory form I would
like to show the current quantity on hand by taking the sum of the activties
shown on the activity subform and create/display an updated quantity on hand
text box.

I hope this helps. Now that I write it, it sounds pretty basic but I do not
know how to do this and I have looked in the help and the knowledgebase and
not found any hints.

Thanks!
steve
 
You can create a summary text box on the subform footer and reference it in
a text box on the main form. Otherwise, try a domain aggregate function in a
control source like:
=DSum("TransAmt","tblTransactions","ItemNum=" & [ItemNum])
 
Back
Top