Combo Box and Option Group

karinos

Registered User.
Local time
Today, 14:55
Joined
Jan 6, 2008
Messages
24
Hi,
I have this form called LOB Selection Tab. I want the user to go to this form and choose from the drop down box any selection he/she wants and then select one of the group options below like:
add to existing contract
Category unvialble and etc.....

So i want a macro or vba code that pulls the data based on the user's selection. The table that has this info is called "MainForm Tab1 Table"

Here is summary of what i am trying to say. For instance, the user selects "Surgical" from the drop down box and then selects "add to existing contract" from one of the option groups, so i want to see is the form to return only where there is only check mark has been placed in the add to existing contract field against Surgical. In other words, only filter a Surgical from the LOB field where there a check mark has been placed. I hope i am not confusing. I have already started to write some code but it does not seem that it is going well so far. Thanks in advance for your time and efforts.
 

Attachments

Here is summary of what i am trying to say. For instance, the user selects "Surgical" from the drop down box and then selects "add to existing contract" from one of the option groups, so i want to see is the form to return only where there is only check mark has been placed in the add to existing contract field against Surgical.
Yes, of course, so you're just trying to filter a pop-up form.

This would be a bit easier for you I think, if there was no option group involved here. Have you read anything about using frames? You have an option group here of 9 buttons, but your frame is not bound to a specific field. It can't be though, because each button represents a different field. You can't do this (not as far as I know anyway). If you're going to represent each yes/no field in the table with a separate option button, drop the frame entirely so you can assign boolean values to the button controls. Right now they don't have this. They just have values to indicate their "uniqueness" in the group.

If you take them out of the group and list them separately, you can loop through them, and use their names to create a WHERE clause in an "OpenForm" command behind the "Run" button. The only problem with this, is that, I wonder if you would have to loop for each button's "Update" event the way I did for the one in the sample? In the attached file, I wrote a loop on the "Add to Existing Contract" button. Click some of the other buttons to highlight them, and then click the "Existing Contract" button. All the other buttons reset to 0. I did this because it's obvious that you only want one button selected.

I added the docmd command behind the button too. Clicking on it opens the "FilteredForm" form object, and restricts records to those that satisfy the "Existing Contract" button and the combo box criteria.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom