Continuous Form With Subtotals

G

Guest

I have a continuous form that is bound to tblClient. For each Client listed I
need to be able to make changes to Client data and see a total of Invoice
Hours, Invoice Amount and Invoice count for the client. tblInvoice is owned
by tblClient and known by InvoiceID. I have tried a query over tblClient with
subqueries over tblInvoice, which works fine except I can't make changes to
the Client Name and Address.

I have tried Dsum as follows, but can't get it to work.
Private Sub Form_Current()
Me.Hrs = DSum ("InvoiceHours", "tblInvoice", "InvoiceClientID = " &
[Me.ClientID])
End Sub

What am I missing?
 
A

Albert D. Kallal

Hum, A query with child records joined in is actually editable by ms-access.

However, with domain functions (sum, count), then the resulting query will
not be editable.

So, the "rule" of thumb, is if the child records (that you join in) can be
resolved to ONE record/row, then you can *usually* edit it.
(with sum commands, there is MORE then one record that belongs to the
row..and, thus no editing).

However, you can place a dsum(), or a dcount() in a continues form. It will
be a bit sluggish, but it does work.

So, you simply based the continues form on a query, and then add a few
additional text boxes.

For the sum textbox, you go:

=dsum("InvoiceHours","tblInvoice","invocieclientID = " & me!ClientID)

You can also use dcount...
 

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