Passing Multiple value to a query

  • Thread starter Thread starter lalexander
  • Start date Start date
L

lalexander

Could anyone tell me how to pass multiple values to a query?

I have a form that that I want to pass several value of an options object.

eg: 1=Pending , 2=Closed, 3=Terminated , 4=Hold , 5=ALL

I want the Option#5 (ALL) to include number 1 though 4 )

I tried passing it as = pvalue=1 or 2 or 3 or 4 ( but I only get the last
value(4) being passed.

I can select Indivdual , but I also want to ability to include all values

Thank You.

Leonard
 
Thanks for the response.

I tried the pvalue IN(1,2,3,4) , but it's keep giving me some error.

Is it possible that the syntax should be pvalue INT(1,2,3,4) ?
Even that expression didn't work for me.

I really appreciate your help to get this working.
 
Are you looking to use it as criteria in a query?

Then use an IIF statement --
Like IIF([Forms]![YourForm]![OptionGP] < 5,
[Forms]![YourForm]![OptionGP], Null) & "*"
 
Assuming the field being searched is numeric, that won't work Karl: you can
only use LIKE with text fields.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


KARL DEWEY said:
Are you looking to use it as criteria in a query?

Then use an IIF statement --
Like IIF([Forms]![YourForm]![OptionGP] < 5,
[Forms]![YourForm]![OptionGP], Null) & "*"

--
KARL DEWEY
Build a little - Test a little


lalexander said:
Thanks for the response.

I tried the pvalue IN(1,2,3,4) , but it's keep giving me some error.

Is it possible that the syntax should be pvalue INT(1,2,3,4) ?
Even that expression didn't work for me.

I really appreciate your help to get this working.
 
How can you pass multiple selections from a numeric options field from a
form in a query then.
I'm still looking for that "Million Dollar Answer"

Say I need to concactenate the following numeric option field - varpar=1,2,3
4
and have the query act upon "varpar" and select each value as a group ????
would the Like function be the way to go?

================================================

Douglas J. Steele said:
Assuming the field being searched is numeric, that won't work Karl: you
can only use LIKE with text fields.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


KARL DEWEY said:
Are you looking to use it as criteria in a query?

Then use an IIF statement --
Like IIF([Forms]![YourForm]![OptionGP] < 5,
[Forms]![YourForm]![OptionGP], Null) & "*"

--
KARL DEWEY
Build a little - Test a little


lalexander said:
Thanks for the response.

I tried the pvalue IN(1,2,3,4) , but it's keep giving me some error.

Is it possible that the syntax should be pvalue INT(1,2,3,4) ?
Even that expression didn't work for me.

I really appreciate your help to get this working.




message
pvalue IN (1,2,3,4)
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

Could anyone tell me how to pass multiple values to a query?

I have a form that that I want to pass several value of an options
object.

eg: 1=Pending , 2=Closed, 3=Terminated , 4=Hold , 5=ALL

I want the Option#5 (ALL) to include number 1 though 4 )

I tried passing it as = pvalue=1 or 2 or 3 or 4 ( but I only get the
last
value(4) being passed.

I can select Indivdual , but I also want to ability to include all
values

Thank You.

Leonard
 
I am using Access 2002 - SP3 and it works for me.
--
KARL DEWEY
Build a little - Test a little


Douglas J. Steele said:
Assuming the field being searched is numeric, that won't work Karl: you can
only use LIKE with text fields.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


KARL DEWEY said:
Are you looking to use it as criteria in a query?

Then use an IIF statement --
Like IIF([Forms]![YourForm]![OptionGP] < 5,
[Forms]![YourForm]![OptionGP], Null) & "*"

--
KARL DEWEY
Build a little - Test a little


lalexander said:
Thanks for the response.

I tried the pvalue IN(1,2,3,4) , but it's keep giving me some error.

Is it possible that the syntax should be pvalue INT(1,2,3,4) ?
Even that expression didn't work for me.

I really appreciate your help to get this working.




pvalue IN (1,2,3,4)
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

Could anyone tell me how to pass multiple values to a query?

I have a form that that I want to pass several value of an options
object.

eg: 1=Pending , 2=Closed, 3=Terminated , 4=Hold , 5=ALL

I want the Option#5 (ALL) to include number 1 though 4 )

I tried passing it as = pvalue=1 or 2 or 3 or 4 ( but I only get the
last
value(4) being passed.

I can select Indivdual , but I also want to ability to include all
values

Thank You.

Leonard
 
WHERE (MyField = Forms!MyForm!MyOptionGroup OR Forms!MyForm!MyOptionGroup =
5)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


lalexander said:
How can you pass multiple selections from a numeric options field from a
form in a query then.
I'm still looking for that "Million Dollar Answer"

Say I need to concactenate the following numeric option field -
varpar=1,2,3 4
and have the query act upon "varpar" and select each value as a group ????
would the Like function be the way to go?

================================================

Douglas J. Steele said:
Assuming the field being searched is numeric, that won't work Karl: you
can only use LIKE with text fields.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


KARL DEWEY said:
Are you looking to use it as criteria in a query?

Then use an IIF statement --
Like IIF([Forms]![YourForm]![OptionGP] < 5,
[Forms]![YourForm]![OptionGP], Null) & "*"

--
KARL DEWEY
Build a little - Test a little


:

Thanks for the response.

I tried the pvalue IN(1,2,3,4) , but it's keep giving me some error.

Is it possible that the syntax should be pvalue INT(1,2,3,4) ?
Even that expression didn't work for me.

I really appreciate your help to get this working.




message
pvalue IN (1,2,3,4)
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

Could anyone tell me how to pass multiple values to a query?

I have a form that that I want to pass several value of an options
object.

eg: 1=Pending , 2=Closed, 3=Terminated , 4=Hold , 5=ALL

I want the Option#5 (ALL) to include number 1 though 4 )

I tried passing it as = pvalue=1 or 2 or 3 or 4 ( but I only get the
last
value(4) being passed.

I can select Indivdual , but I also want to ability to include all
values

Thank You.

Leonard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top