Option Group Define Subform Data?

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
 
R

Rick Brandt

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
 
S

Steve Schapel

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
 
S

Sean

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
 

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