Change Record number of sub form

B

Brad

Thanks for taking the time to read my question.

I have a form that has 2 sub forms.

Main form = a
Subform of a = b
Subform of b = c

I am writing a function that opens up the main form, and
goes to the first record on the main form.

I then want to run some code on form c (a command
button), then I want to move to the next record of form
c, until there are no more records.

Then I'd like to move to the next record on form b and
repeat all steps required on form c.


If you need more description, please write and I'll add
more.

Here is the code I have so far.

The msgbox line is to prove to myself that I am using the
Forms! property correctly. The message box returns a
value.

My code stops on the last line and the error says that
the form isn't open.

Thanks for your help.

Brad

-------------

Code:


Function CalculateAll()


DoCmd.OpenForm "frmtblESIOperationSiteInfoMeter", acNormal
DoCmd.GoToRecord
acDataForm, "frmtblESIOperationSiteInfoMeter", acFirst

'MsgBox Forms!frmtblESIOperationSiteInfoMeter!
frmtblBarnInfoMeter!frmtblMeterInfo.Form.MeterDateRecorded

'problem starts here.
DoCmd.GoToRecord acDataForm, "Forms!
frmtblESIOperationSiteInfoMeter!frmtblBarnInfoMeter!
frmtblMeterInfo.Form.meterdaterecorded", acNext


End Function
 

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