[Your second post today came in while I was typing this, so I'm still putting this one in. I just wanted to note that it started a little bit ago, immediatley after my first post today. -- Editor]
This is in a post separate from the first one I put up today, because the point I'm going to make is completely separated from those of that post.
Now that I see what your project is, fredk, and what all you are trying to do, or how you're going about it, you may not want to use constants like Dascit and so forth.
From what I see now, Dascit is a broker associated with one user or more, but not associated with all users. Your option group controls remain the same, but the labels change. (See the code you posted near the top of your second-most-recent posting of Dec 2, 2002.) So Label26 sometimes reads "Dascit" and sometimes reads "Glenn" and sometimes (presumably) reads other things. And Label26 is by a control (CheckBox, RadioButton, whatever), which sets the option group's value when it is selected/checked. That control *always* returns the same value -- you *could* change the control's option group value, but I don't see you doing that in code, so it always returns the same value. Let's say that the value returned is 567 (just a number pulled from thin air; it won't matter if you aren't using it for math; could be 1, could be -8, but this time, it's 567

).
The single Select Case statement above can indeed tell if lngOptionGroupValue is equal to 567. But what then, fredk? How does your code distinguish between 567 meaning "Dascit" and 567 meaning "Glenn" and 567 meaning, say, "Bubba Claus" (my imaginary example "other" broker)???
So you have to be able to answer that question with something other than "it doesn't"

. Eventually, anyway.
There are multiple possible approaches, as there almost always are.
You could set the OptionValue properties of the various controls in the option group at the same time you set the Caption properties of their labels. So that first control's OptionValue would be 1 when the label is "Dascit" and the control means the broker Dascit, and the constant Dascit would be equal to 1. And ... That first control's OptionValue would be 16 when the label is "Glenn" and the control means the broker Glenn, and the constant Glenn would be equal to 16. And so forth. That would let you safely use the scheme we've already come up with pretty well.
OR... You could leave the Option Values alone and have Select Cases inside of each Case of the main one. You'd have something like this:
Code:
With Forms![SACSpecific]
Select Case .lngOptionGroupValue
Case 1
Select Case .Label26
Case "Dascit"
'DO STUFF
Case "Glenn"
'DO STUFF
'...Other Cases...
Case Else
'DO STUFF
End Select 'Case .Label26
Case 2
Select Case .Label28
Case "TRA"
'DO STUFF
Case "Scott"
'DO STUFF
'...Other Cases...
Case Else
'DO STUFF
End Select 'Case .Label26
'...Other Cases...
Case Else
'Handle it as you like
End Select
End With
... But with this solution, you'd have to have all of your possibilities hard-coded in multiple places, that is, explicitly typed out in the code. And any changes would require you to change your code and re-compile ... not the prettiest way to do it, though it will work.
OR ... another choice, and probably one you won't want to mess with at this moment, if you need to get your project just working ... You could set up a table that lists every broker for each user, with a unique number assigned to each. When a user opens the form, the form could read the list of applicable brokers from that table, and *on the fly*, add controls to the option group for each broker, and set the properties for each control and its label. Then the form code could use values from the table in the Select Case evaluation; perhaps the table would even just contain the criteria you'd use, but I'd need to think it out a bit more. This would be a somewhat advanced task, mostly just requiring careful thinking about logic and layout of the created controls on the form.
In any case, since your values are going to be changing depending on the user, you need to take that into acount in your coding. Do you actually *understand* why I suggested using constants, and how your Select Case code relates to your form design? Do you understand how the Select Case statement works?
--------
Another idea I had last night, and just remembered this morning: What about using a ListBox or ComboBox, instead of an option group with CheckBoxes or similar controls? The ListBox portion of either control could have columns with broker names or whatever choices you offer. Then the code, instead of using code that chooses among options (like Select Case or If Then statements), could just loop through selected items in the list, building directly with the strings that are the first column of the list, adding to the WHERE clause or filter criteria as selected items are "looped through".
In fact, the list's RecordSource could have *everyone's* brokers/choices, and simply be further filtered when you know whih user is accessing the form.
This is an approach, a strategy, not the complete solution, obviously

.
Until the next letter... -- C Vigil =)
(Before becoming a member, I also signed on several posts as
"JustPassingThru" and "QuickieBoy" -- as in "Giving Quick Answers"
