S
S Jackson
I have built a search form. It contains an onClick event behind a Search
button that will open up a subform called [fsubResults] based on the
criteria entered into txtSearch. First, the user must make a selection
from:
Combo box No. 1 [cmboSearch] contains three choices:
1. Search Cases, brings up
- Combo Box No.2 [Typecmbo] containing four choices:
a. Case Name
b. DHS No.
c. Vendor
d. Action
- AND for each selection in [Typecmbo], the user can select
one of three option buttons [OptnCase]:
i. Open
ii. Closed
iii. All
2. Search LTCR Staff
3. Search Facility Attorneys
I started out with code to allow the user to select from [cmboSearch] and
then the Option group
Select cmboSearch.Value
Case "Search Cases"
Case "Search LTCR Staff"
Case "Search Facility Attorneys"
Under Case "Search Cases" I have set a stLinkCriteria , then an if statment
for the value of the OptnCase, and then built an strSQL string incorporating
the stLinkCriteria and the value of the OptnCase in the WHERE statement:
& "WHERE (((tblCaseInfo.CaseName)" & stLinkCriteria & ") And
((tblStatus.ClosedDate) Is Null)) " _
Then I decided to be brave and added the Typcmbo to allow the user to search
for a record using other values in addition to "CaseName." Selections from
the Typcmbo will change the WHERE statement of the SQL. How do I nest
Select Case statement? I would like to use Case Select for the Typecmbo and
then a third for the OptnCase.
I know I can build a thousand strSQL strings, but it seems to me there has
to be an easier way to do this.
TIA
S. Jackson
button that will open up a subform called [fsubResults] based on the
criteria entered into txtSearch. First, the user must make a selection
from:
Combo box No. 1 [cmboSearch] contains three choices:
1. Search Cases, brings up
- Combo Box No.2 [Typecmbo] containing four choices:
a. Case Name
b. DHS No.
c. Vendor
d. Action
- AND for each selection in [Typecmbo], the user can select
one of three option buttons [OptnCase]:
i. Open
ii. Closed
iii. All
2. Search LTCR Staff
3. Search Facility Attorneys
I started out with code to allow the user to select from [cmboSearch] and
then the Option group
Select cmboSearch.Value
Case "Search Cases"
Case "Search LTCR Staff"
Case "Search Facility Attorneys"
Under Case "Search Cases" I have set a stLinkCriteria , then an if statment
for the value of the OptnCase, and then built an strSQL string incorporating
the stLinkCriteria and the value of the OptnCase in the WHERE statement:
& "WHERE (((tblCaseInfo.CaseName)" & stLinkCriteria & ") And
((tblStatus.ClosedDate) Is Null)) " _
Then I decided to be brave and added the Typcmbo to allow the user to search
for a record using other values in addition to "CaseName." Selections from
the Typcmbo will change the WHERE statement of the SQL. How do I nest
Select Case statement? I would like to use Case Select for the Typecmbo and
then a third for the OptnCase.
I know I can build a thousand strSQL strings, but it seems to me there has
to be an easier way to do this.
TIA
S. Jackson