In access 2010 database, I have a master form FormMaster and a subform SubFrm and I also have option group with two options optionA,option B on main form
what I want to achieve is when user changes the option ,I want to bind frmOpA to subform and when user checks option B I eant to bind frmOpB to subform FormSub
I was able to get this working using the after update event of the option group using the following code
Private Sub FrameTgt_AfterUpdate()
Select Case FrameTgt.Value
Case 1
Forms("FormMaster").Form.SubFrm.SourceObject = "frmOpA"
Case 2
Forms("FormMaster").Form.SubFrm.SourceObject = "frmOpB"
End Select
End Sub
the code changes the subforms source object fine but it doesn't seem to pull the data i.e it doesn't requery
I have tried
Case 1
Forms("FormMaster").Form.SubFrm.SourceObject = "frmOpA"
Me!Subfrm.Form.Requery
but it doesn't seem to refresh I have also tried to link master and child fields in vba but no use !
any ideas?