how to reference a subform within a subform

pogs

New member
Local time
Today, 03:30
Joined
Jan 30, 2008
Messages
5
i have a form- frmCompany. It has a subform- subfrmExams. Then the subfrmExams has another subform within it- subfrmPackage. I opened the main form-frmCompany in hidden view using another Form.

I want to control the subform-- subfrmPackage, so that it would go to the next record. How do i do this using visual basic?;)
 
bob,

Very nice article!
:D
 
this is only for subforms, i have a subform within a subform.
could i docmd do?
Docmd.gotorecord acdataform Forms!frmCompany!subfrmCompanyExam!Package,,nextrecord
The reference to the subform does not seem to work...shall i continue with this or a
For Each ctl in.....?
 
This is my code: i want to reference subform2:"frmCompanyPackageSub". i think this is not working

For Each ctl In Forms!frmCompany
If ctl.Name = "frmCompanyPackageSub" Then
Set rst = ctl.Form.RecordsetClone
rst.MoveFirst
Do Until rst.EOF
If Con2(36) = True Then
For I = 1 To 35
Con1(I).Value = Con2(I)
Next
End If
rst.MoveNext
'If rst.BOF And rst.EOF Then Exit For
Loop

End If

Next ctl
 
i also tried a docmd method:
DoCmd.GoToRecord acDataForm, Forms!frmCompany!frmCompanySub!frmCompanyPackageSub.Form, , acNext

it has an error: An expression you entered is in the wrong data type for one of the arguments
 

Users who are viewing this thread

Back
Top Bottom