Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need continu. form w/ updatable fields & AggDomains

Status
Not open for further replies.

smandoli9

Programmer
Jun 10, 2002
103
US

Form set to show Continuous, not Single. Two totals are displayed. The first is a sum from a many-to-one table (a drill-down button takes you to the details). The other is the first total plus a user-entered amount.

EXAMPLE: Orders for items being purchased. The form shows one record for each order, continuously. Each record (each order) shows the total purchase price as a single figure, and a final billing amount which is the purchase price plus shipping cost. There is a field for entering that cost. User enters a value for Shipping and sees the final billing amount update on the form.

WHAT HASN'T WORKED:
My latest attempt used a DLookUp() in the field for final billing amount. But I couldn't see how to set the criteria (order number) as part of the function. Got "#Name" whenever I switched from a simple numeric value to a reference to the current order number.

I've tried the same thing using VBA to populate the field (updates on Form_AfterUpdate or some such).

One standard approach is to use a subform to roll up totals, but that doesn't work with continuous forms.

I suspect the continuous form is the problem with all these approaches.

WHAT I STILL HOPE TO AVOID:
Two subforms, one updateable and one for totals, with Requeries sprinkled around the form/control events.

How can I do this?

[purple]_______________________________
Never confuse movement with action -- E. Hemingway [/purple]
 
I've tried the same thing using VBA to populate the field (updates on Form_AfterUpdate or some such).

With VBA, I got past a #Name issue. What displays is the total figure, but for the first of the records -- the same figure is then used for all records below. So the challenge remains the use of continuous form, apparently.

[purple]_______________________________
Never confuse movement with action -- E. Hemingway [/purple]
 
GOT IT. DLookUp() in the form control.

=DLookUp("[PurchaseTotal]","[OrderTotals]", _
"[Order_ID] = " & [Order_ID_foreign])

I think I can switch to DSum and skip a query that does the aggr. functions, wonder is speed will differ.

[purple]_______________________________
Never confuse movement with action -- E. Hemingway [/purple]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top