Option group

rupes_mahal

Registered User.
Local time
Today, 14:46
Joined
Aug 12, 2001
Messages
60
Hi

I am trying to setup a search form. I have used the Option Group tool, to create 6 different options.

EG.

Options

1) Premise Code
2) Partnership Code
3) Practice Code
4) Doctor's Code
5) Doctor's Name
6) Address

i have also inserted a Combo box in the search form.

Now..what I am trying to do is if I need to do a search, I have to pick one of the options(highlight the option button).

When I have selected the option, the combo box now should have all the data related to it coming back from a column in a table. So when an option is picked, the combo box should display the related data in it, which comes from a table. So now i can pick the data i want to search by from the drop down combo box.

To understand what I am talking about, look at the exapmles that come with Microsoft access, "Address Book" (form "FindForm").

Can anyone please help me out here, as i have been trying to work it out on how to do it. Also, I need to know, if I can display more then one columns data in the combo box. meaning, that i want one drop down menu, with 4 columns data in it.

Please help..

thank you in advance.

Ruby
 
-Make a form with an option group with the 6 options you specified
-Return value 1 for 1st option, 2 for 2nd etc
-Make a combo box
-Set the after update event for the option group frame as follows:

Private Sub Frame0_AfterUpdate()

Select Case Frame0.Value

Case 1
Me!Combo1.RowSource = "SELECT [Table1].[Premise_Code] FROM Table1;"
Case 2
Me!Combo1.RowSource = "SELECT [Table1].[Partnership_Code] FROM Table1;"
Case 3
Me!Combo1.RowSource = "SELECT [Table1].[Practice_Code] FROM Table1;"
Case 4
Me!Combo1.RowSource = "SELECT [Table1].[Doctors_Code] FROM Table1;"
Case 5
Me!Combo1.RowSource = "SELECT [Table1].[Doctors_Name] FROM Table1;"
Case 6
Me!Combo1.RowSource = "SELECT [Table1].[Address] FROM Table1;"
End Select

End Sub

-Each time a different option is selected, the rowsource for the combo box changes
-Use the after update event of the combo box if you want selecting an item to trigger a search
 

Users who are viewing this thread

Back
Top Bottom