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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Case with Controls

Status
Not open for further replies.

rookery

Programmer
Apr 4, 2002
384
GB
Is it possible to use a Select Case statement to determine which control (eg. a series of CheckBoxes in this situation) has been selected?
 
Not directly. You will need to find out which one is selected, then perform your select case routine.

The way I do this is to put a code on the tag of the control to identify the ones I need to check:

Dim ctl as Control
Dim sCtlName as string
For each ctl in me.controls
if ctl.tag="UseMe" then
if ctl=true then
sctlname=ctl.name
end if
end if
next ctl

select case sCtlName
.
.
.
end select

A better way (just thought of this!) would be to put them into a frame control. You can then change the settings of the frame so that only one can be selected, each box will have it's own value which you can then use:

Select case me.CheckBoxFrame.Value
.
.
.
End Select

HTH

ben ----------------------------------------
Ben O'Hara
----------------------------------------
 
Thanks for your help Ben. Will give it a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top