Hello everyone! Using A2K
i have a form(a) with a subform(b) and within the subform there is a
continuous subform(c).
in the subform (b) there is a command button used to call a public function
(CubiertaCalculacion) which holds a calculation for form (c)(grandchild)
..............The calculation stores the result on a field (Total) on the
continuous subform(c) (grandchild) based on another two fields on the same
subform .............e.g. field1 (Quantity) Field2(Price)
Total(Field1*Field2) by the way this a sample calculation as the real one is
very complex and I cannot place it on the query(qryCubierta) the record
source of the continuous subform(c).
The calculation on the public function works fine, my problem is that when I
run the code from the subform(b) it only affect the first record showing on
subform(c) and I want the code to calculate the TOTAL for every record
showing on the continuous subform(c).
This ist the code behind the command button;
Private Sub Command48_Click()
Dim mydb As DAO.Database
Dim rst As DAO.Recordset
Set mydb = CurrentDb()
Set rst = mydb.OpenRecordset("qryCubierta", DB_OPEN_DYNASET)
Do Until rst.EOF
Call CubiertaCalculacion
rst.MoveNext
DoEvents
Loop
End Sub
I have placed the command button on the detail section of the continuous
subform(c) and it works fine, by it would implicate the user pressing the
button for every record showing to get a result, and I would prefer it as
explained above.
If any of you know what is wrong with my code, I would appreciate your
suggestion or working example.
Thanks