opopanax666
Registered User.
- Local time
- Today, 15:11
- Joined
- Nov 2, 2006
- Messages
- 44
Hi everyone,
I have a main, a subform and a optiongroup on the subform. The subform-container is called "SubFrm", and is initially loaded with "frmTransportmiddel". When a button in the optiongroup is pressed, the container needs to load another form ("frmProductgroep").
The code:
When I press a button in the optiongroup, I get an error 2465 "can't find field SubFrm". When I use the exact same syntax with a button on the main, it works. So I guess it's a reference problem...
I thought that maybe it was a "focus" problem, but even when I change the code to focus a control on the main before changing sourceobject, it doesn't work either...
Any feedback would be appreciated!
I have a main, a subform and a optiongroup on the subform. The subform-container is called "SubFrm", and is initially loaded with "frmTransportmiddel". When a button in the optiongroup is pressed, the container needs to load another form ("frmProductgroep").
The code:
Code:
Private Sub optgrpRollend_AfterUpdate()
If Me.optgrpRollend.Value = 16 Then
DoCmd.OpenForm "frmAantalMK"
Else
TRol = DLookup("Transport_gewicht", "qryTransport_middelen_soort", "Soort_ID = " & Me.optgrpRollend.Value)
sngTarra = sngTarra + TRol
Me.Parent.txtMainTarra.Value = sngTarra
Me!SubFrm.Form.SourceObject = "frmProductgroep"
End If
End Sub
When I press a button in the optiongroup, I get an error 2465 "can't find field SubFrm". When I use the exact same syntax with a button on the main, it works. So I guess it's a reference problem...
I thought that maybe it was a "focus" problem, but even when I change the code to focus a control on the main before changing sourceobject, it doesn't work either...
Any feedback would be appreciated!