Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT! Select value from option group 1

Status
Not open for further replies.

incagold

Programmer
Mar 21, 2003
54
I posted this question earlier today but forgot to note it as urgent. Sorry for the re-post, but we could really use some help quickly. If what we are asking can not be done, please tell us.

Is it possible to select a value from an option group and have that value determine which query to use for a subform? If so, can you provide an example of the code?

The objective is to select 1 of 3 values in a selction group which determine different finacial data to display. I cannot be very specific because of the nature of our business but for example option 1 would be budgetary data for an aircraft simulator, option 2 would be the same type of budgetary for spare parts for the simulator while option 3 would display all financial data associated with the simulator. Once selected the subform provides the link via selection to several additional subforms appropriate to the 3 options above

I am relatively new to Access and am trying to learn. You have provided me value assistance previously via threads and your base of FAQs and Posts. I'm hoping I have explained my problem sufficiently for you and offer my sincere thanks in advance for any help.
 
If you want to base the subforms recordsource based on the option selected in the option group, then in the AfterUpdate event of the the option group, set the recordsource property of the subform (assume the option group is named grpQuery and the subform control is name subFormControl)

if (grpQuery.value = 1) then
me!subFormControl.form.RecordSource = "YourQuery1"
ElseIf (grpQuery.value = 2) then
me!subFormControl.form.RecordSource = "YourQuery2"
Else
me!subFormControl.form.RecordSource = "YourQuery4"
end if
 
Thank you so much for the reply. I tried your suggestion and it worked fine!!.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top