Link to home
Start Free TrialLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

Userform and Pagetab selection Create unuqie dynamic sql statement based on selections

Excel 2003
vba

Userform1
MultiPage1
several tabs but specifically  "Page4"
33 option buttons ( using the caption names as my value for the "where" sql statement

I currently have no "Frame"


I need to be able to select no more than 3 option buttons at one time.
They can select only 1 or 2 or 3 option boxes

So using I assume a Case Select statement build my "WHERE" sql statement.

BASIC sql Statement below : For 3 Options chosen

SELECT tblXrefInfo.*
FROM tblXrefInfo
WHERE (((tblXrefInfo.MFRNAME)="NAME1")) OR (((tblXrefInfo.MFRNAME)="NAME2")) OR (((tblXrefInfo.MFRNAME)="NAME3"));

NAME1 2 3  would be substituted for 3 option boxes "Caption Value"


Thanks
fordraiders
ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Fordraiders

ASKER

ok...just for all , I added a frame control and then assigned the "optionbox" a unique "groupnname" so I could multiselect !
what if I only select "1" control ?
It should still work with an IN clause.
ok will try it later
Thanks very much