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!

More Parameter Problems!

Status
Not open for further replies.

FoxStudent

Technical User
Feb 24, 2000
85
GB
I am still having problems with my query posted in Paramater Problems! (P.S. kathyrn did have the line of code that is causing my problem correct). The user has to select one of two values from a combo box and there are 12 combo boxes. I have discoved that when the message comes up to few parameters there should be X. X is the number of combo boxes that I have selected a value in. Has anyone any suggestions. I seen an example where before selecting a value from a combo box u have to check a check box beside it. However, I would prefer not to do this!

thank u
Grainne
 
OK so are you saying if all 12 combo boxes are not choosen you get a error?
In your parameter query did you try using the "Like" statement

Like:
"Select* From YourTable Where Yourfield Like '" & Me!Combo1 & "*';" ..... DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
If a combo box has data in it add it to tor SQL string Where, e.g.

if me!combo1 & &quot;&quot; <> &quot;&quot; then strSQL = strSQL & &quot; AND [cb1] =&quot; & combo1
if me!combo2 & &quot;&quot; <> &quot;&quot; then strSQL = strSQL & &quot; AND [cb2] =&quot; & comb02

etc.

It's not quite this easy as you don't want an &quot;AND&quot; immediately following a WHERE, so you have to add other ttest too. But this shows the principal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top