Option Group Define Subform Data?

  • Thread starter Thread starter Sean
  • Start date Start date
S

Sean

Hi,

I would like to use an option group on a mainform to determine the dataset
used in the subform. I have the main form and subform created, but I cant
figure out how to get the option group's value to determine the dataset. I
know there is code that can do this but what is it? Thank you very much.

Sean
 
Sean said:
Hi,

I would like to use an option group on a mainform to determine the dataset
used in the subform. I have the main form and subform created, but I cant
figure out how to get the option group's value to determine the dataset. I
know there is code that can do this but what is it? Thank you very much.

In the AfterUpdate of the OptionGroup have code similar to. . .

Select Case Me!OptionGroupName
Case 0
Me!SubformControlName.Form.RecordSource = "Some Source"
Case 1
Me!SubformControlName.Form.RecordSource = "Some Other Source"
Case etc..
End Select
 
Sean,

Use the Option Group's AfterUpdate event. Something like this...
Select Case Me.OptionGroupName
Case 1
Me.SubformName.Form.RecordSource = <something>
Case 2
Me.SubformName.Form.RecordSource = <or other>
End Select

- Steve Schapel, Microsoft Access MVP
 
Thank you Rick.


Rick Brandt said:
much.

In the AfterUpdate of the OptionGroup have code similar to. . .

Select Case Me!OptionGroupName
Case 0
Me!SubformControlName.Form.RecordSource = "Some Source"
Case 1
Me!SubformControlName.Form.RecordSource = "Some Other Source"
Case etc..
End Select
 
Back
Top