Expression in Query Criteria

K

Klatuu

Okay, but I wont be able to get to it until tomorrow, I am in the middle of
hot project at the moment.

(e-mail address removed)

jwinder said:
anyway I can send them to you?

Klatuu said:
Without the objects in front of me, I can't tell. I know the examples I sent
work, because I use both versions.

ryan_eng said:
I have a similar problem to jwinder.
I have a subform with 3 combo boxes that have to be all related. The first
one is Task_ID, a combo box that grabs a list from another table. The second
is Act_Type, which is just a list I enterred manually. The third is Act_ID,
which is based on a query and needs to be filtered using the values of the
previous two combo boxes. I tried using the expression Klatuu dug up but its
not working. I still get the "enter parameter value" dialog box with the
expression shown.

I really need this to work, pleeeeeease help me.

RYAN


:

Okay, I had to go back and dig out an app I did 6 yrs ago and found the right
syntax. Mine is this:
Like [Forms]![frmClientSearch]![txtLastName] & "*"

So your's should be like this:
Like [Forms]![Query - Catalog Append Table]![Basic_Category] & "*"
:

nope...doesn't work that way either.

:

Should be the name of the combo box. I wonder if because you are using LIKE,
it should be :

Like "'" & [Forms]![Query - Catalog Append Table]![Basic_Category] & "'"

:

nope..still did not work. I now have
Like [Forms]![Query - Catalog Append Table]![Basic_Category]

Should the [Basic_Category] be the field name of the table or the name of
the Combo Box? As it is, it is the name of the Combo Box.

:

hmmmm, I thought I had copied from your post. You only need it one time:
Like [forms]![MyFormName]![Basic_Category]
:

yes...one column. I was just doing what I thought you asked me to do...

you wrote: Like [forms]![MyFormName]![Basic_Category] & [Forms]![Query -
Catalog Append Table]![BasicCategory] & [forms]![MyFormName]![Basic_Category]


:

Now you are up to 3 times. Is this all in the criteria for one column in the
query? It doesn't seem to make any sense.

:

seems llike I have something in there too many times... I now have the
following:
Like [forms]![Query - Catalog Append Table]![Basic_Category] &
[Forms]![Query - Catalog Append
Table]![BasicCategory] & [forms]![Query - Catalog Append
Table]![Basic_Category]

When I run the Query (with no criteria in any of the fields) i get a pop up
box with the title "enter Parameter Value" and below that
"Forms!Query-Catalog Append" then a blank List Box.


:

Like [Me].[Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [Me].[Basic_Category]
I'm curious as to why you have basiccategory in criteria twice. Try it like
this:
Like [forms]![MyFormName]![Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [forms]![MyFormName]![Basic_Category]

:

nope..didn't work. :-(

this what I entered:
Like [Me].[Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [Me].[Basic_Category]
(When I saved it, it put in the extra Brackets around Me. and Basic_Category)

This is what I put into the other fields:
Like "*" & [Forms]![QueryFormName]![FieldName] & "*"

:

Refer to the value of the combo box in the query's criteria box

Me.MyCombo

:

New Problem: Is there a way to have the expression in the Query Criteria box
search for values in a pull down list in a Combo Box on the query Form?
I.E. say there are four values in the combo box pull down list ( Cat, Dog,
Fish, Bird). If one of those values is selected (Dog) via the pull down list,
what does the expression have to look like to search for the selected value
(Dog)?
 
R

ryan_eng

Is there any way I can get you to look at it? I've tried to write the
expression all different ways and it still gives the popup parameter entry.
I'm assuming the problems lie in that the combo box is in a subform, but I'm
pretty sure I covered that with the syntax:
[Forms]![frm_Time_Tracking]![frm_Time_Tracking_Details]![Forms]![Time_Type]
correct me if I'm wrong.

Do I need to simply write the above in the criteria box or am I missing
something? Am I missing something with the After Update requery?

RYAN

Klatuu said:
Without the objects in front of me, I can't tell. I know the examples I sent
work, because I use both versions.

ryan_eng said:
I have a similar problem to jwinder.
I have a subform with 3 combo boxes that have to be all related. The first
one is Task_ID, a combo box that grabs a list from another table. The second
is Act_Type, which is just a list I enterred manually. The third is Act_ID,
which is based on a query and needs to be filtered using the values of the
previous two combo boxes. I tried using the expression Klatuu dug up but its
not working. I still get the "enter parameter value" dialog box with the
expression shown.

I really need this to work, pleeeeeease help me.

RYAN


Klatuu said:
Okay, I had to go back and dig out an app I did 6 yrs ago and found the right
syntax. Mine is this:
Like [Forms]![frmClientSearch]![txtLastName] & "*"

So your's should be like this:
Like [Forms]![Query - Catalog Append Table]![Basic_Category] & "*"
:

nope...doesn't work that way either.

:

Should be the name of the combo box. I wonder if because you are using LIKE,
it should be :

Like "'" & [Forms]![Query - Catalog Append Table]![Basic_Category] & "'"

:

nope..still did not work. I now have
Like [Forms]![Query - Catalog Append Table]![Basic_Category]

Should the [Basic_Category] be the field name of the table or the name of
the Combo Box? As it is, it is the name of the Combo Box.

:

hmmmm, I thought I had copied from your post. You only need it one time:
Like [forms]![MyFormName]![Basic_Category]
:

yes...one column. I was just doing what I thought you asked me to do...

you wrote: Like [forms]![MyFormName]![Basic_Category] & [Forms]![Query -
Catalog Append Table]![BasicCategory] & [forms]![MyFormName]![Basic_Category]


:

Now you are up to 3 times. Is this all in the criteria for one column in the
query? It doesn't seem to make any sense.

:

seems llike I have something in there too many times... I now have the
following:
Like [forms]![Query - Catalog Append Table]![Basic_Category] &
[Forms]![Query - Catalog Append
Table]![BasicCategory] & [forms]![Query - Catalog Append
Table]![Basic_Category]

When I run the Query (with no criteria in any of the fields) i get a pop up
box with the title "enter Parameter Value" and below that
"Forms!Query-Catalog Append" then a blank List Box.


:

Like [Me].[Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [Me].[Basic_Category]
I'm curious as to why you have basiccategory in criteria twice. Try it like
this:
Like [forms]![MyFormName]![Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [forms]![MyFormName]![Basic_Category]

:

nope..didn't work. :-(

this what I entered:
Like [Me].[Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [Me].[Basic_Category]
(When I saved it, it put in the extra Brackets around Me. and Basic_Category)

This is what I put into the other fields:
Like "*" & [Forms]![QueryFormName]![FieldName] & "*"

:

Refer to the value of the combo box in the query's criteria box

Me.MyCombo

:

New Problem: Is there a way to have the expression in the Query Criteria box
search for values in a pull down list in a Combo Box on the query Form?
I.E. say there are four values in the combo box pull down list ( Cat, Dog,
Fish, Bird). If one of those values is selected (Dog) via the pull down list,
what does the expression have to look like to search for the selected value
(Dog)?
 
K

Klatuu

Your syntax is still incorrect.
[Forms]![frm_Time_Tracking]![frm_Time_Tracking_Details]![Time_Type]
What you want is
[forms]![MainFormName]![SubFormName]![ControlName]

ryan_eng said:
Is there any way I can get you to look at it? I've tried to write the
expression all different ways and it still gives the popup parameter entry.
I'm assuming the problems lie in that the combo box is in a subform, but I'm
pretty sure I covered that with the syntax:
[Forms]![frm_Time_Tracking]![frm_Time_Tracking_Details]![Forms]![Time_Type]
correct me if I'm wrong.

Do I need to simply write the above in the criteria box or am I missing
something? Am I missing something with the After Update requery?

RYAN

Klatuu said:
Without the objects in front of me, I can't tell. I know the examples I sent
work, because I use both versions.

ryan_eng said:
I have a similar problem to jwinder.
I have a subform with 3 combo boxes that have to be all related. The first
one is Task_ID, a combo box that grabs a list from another table. The second
is Act_Type, which is just a list I enterred manually. The third is Act_ID,
which is based on a query and needs to be filtered using the values of the
previous two combo boxes. I tried using the expression Klatuu dug up but its
not working. I still get the "enter parameter value" dialog box with the
expression shown.

I really need this to work, pleeeeeease help me.

RYAN


:

Okay, I had to go back and dig out an app I did 6 yrs ago and found the right
syntax. Mine is this:
Like [Forms]![frmClientSearch]![txtLastName] & "*"

So your's should be like this:
Like [Forms]![Query - Catalog Append Table]![Basic_Category] & "*"
:

nope...doesn't work that way either.

:

Should be the name of the combo box. I wonder if because you are using LIKE,
it should be :

Like "'" & [Forms]![Query - Catalog Append Table]![Basic_Category] & "'"

:

nope..still did not work. I now have
Like [Forms]![Query - Catalog Append Table]![Basic_Category]

Should the [Basic_Category] be the field name of the table or the name of
the Combo Box? As it is, it is the name of the Combo Box.

:

hmmmm, I thought I had copied from your post. You only need it one time:
Like [forms]![MyFormName]![Basic_Category]
:

yes...one column. I was just doing what I thought you asked me to do...

you wrote: Like [forms]![MyFormName]![Basic_Category] & [Forms]![Query -
Catalog Append Table]![BasicCategory] & [forms]![MyFormName]![Basic_Category]


:

Now you are up to 3 times. Is this all in the criteria for one column in the
query? It doesn't seem to make any sense.

:

seems llike I have something in there too many times... I now have the
following:
Like [forms]![Query - Catalog Append Table]![Basic_Category] &
[Forms]![Query - Catalog Append
Table]![BasicCategory] & [forms]![Query - Catalog Append
Table]![Basic_Category]

When I run the Query (with no criteria in any of the fields) i get a pop up
box with the title "enter Parameter Value" and below that
"Forms!Query-Catalog Append" then a blank List Box.


:

Like [Me].[Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [Me].[Basic_Category]
I'm curious as to why you have basiccategory in criteria twice. Try it like
this:
Like [forms]![MyFormName]![Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [forms]![MyFormName]![Basic_Category]

:

nope..didn't work. :-(

this what I entered:
Like [Me].[Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [Me].[Basic_Category]
(When I saved it, it put in the extra Brackets around Me. and Basic_Category)

This is what I put into the other fields:
Like "*" & [Forms]![QueryFormName]![FieldName] & "*"

:

Refer to the value of the combo box in the query's criteria box

Me.MyCombo

:

New Problem: Is there a way to have the expression in the Query Criteria box
search for values in a pull down list in a Combo Box on the query Form?
I.E. say there are four values in the combo box pull down list ( Cat, Dog,
Fish, Bird). If one of those values is selected (Dog) via the pull down list,
what does the expression have to look like to search for the selected value
(Dog)?
 
R

ryan_eng

ok, made that change but still getting the parameter entry pop-up. I made
sure that there is a requery in the After Update event for it. Anything else
I could be missing?

RYAN

Klatuu said:
Your syntax is still incorrect.
[Forms]![frm_Time_Tracking]![frm_Time_Tracking_Details]![Time_Type]
What you want is
[forms]![MainFormName]![SubFormName]![ControlName]

ryan_eng said:
Is there any way I can get you to look at it? I've tried to write the
expression all different ways and it still gives the popup parameter entry.
I'm assuming the problems lie in that the combo box is in a subform, but I'm
pretty sure I covered that with the syntax:
[Forms]![frm_Time_Tracking]![frm_Time_Tracking_Details]![Forms]![Time_Type]
correct me if I'm wrong.

Do I need to simply write the above in the criteria box or am I missing
something? Am I missing something with the After Update requery?

RYAN

Klatuu said:
Without the objects in front of me, I can't tell. I know the examples I sent
work, because I use both versions.

:

I have a similar problem to jwinder.
I have a subform with 3 combo boxes that have to be all related. The first
one is Task_ID, a combo box that grabs a list from another table. The second
is Act_Type, which is just a list I enterred manually. The third is Act_ID,
which is based on a query and needs to be filtered using the values of the
previous two combo boxes. I tried using the expression Klatuu dug up but its
not working. I still get the "enter parameter value" dialog box with the
expression shown.

I really need this to work, pleeeeeease help me.

RYAN


:

Okay, I had to go back and dig out an app I did 6 yrs ago and found the right
syntax. Mine is this:
Like [Forms]![frmClientSearch]![txtLastName] & "*"

So your's should be like this:
Like [Forms]![Query - Catalog Append Table]![Basic_Category] & "*"
:

nope...doesn't work that way either.

:

Should be the name of the combo box. I wonder if because you are using LIKE,
it should be :

Like "'" & [Forms]![Query - Catalog Append Table]![Basic_Category] & "'"

:

nope..still did not work. I now have
Like [Forms]![Query - Catalog Append Table]![Basic_Category]

Should the [Basic_Category] be the field name of the table or the name of
the Combo Box? As it is, it is the name of the Combo Box.

:

hmmmm, I thought I had copied from your post. You only need it one time:
Like [forms]![MyFormName]![Basic_Category]
:

yes...one column. I was just doing what I thought you asked me to do...

you wrote: Like [forms]![MyFormName]![Basic_Category] & [Forms]![Query -
Catalog Append Table]![BasicCategory] & [forms]![MyFormName]![Basic_Category]


:

Now you are up to 3 times. Is this all in the criteria for one column in the
query? It doesn't seem to make any sense.

:

seems llike I have something in there too many times... I now have the
following:
Like [forms]![Query - Catalog Append Table]![Basic_Category] &
[Forms]![Query - Catalog Append
Table]![BasicCategory] & [forms]![Query - Catalog Append
Table]![Basic_Category]

When I run the Query (with no criteria in any of the fields) i get a pop up
box with the title "enter Parameter Value" and below that
"Forms!Query-Catalog Append" then a blank List Box.


:

Like [Me].[Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [Me].[Basic_Category]
I'm curious as to why you have basiccategory in criteria twice. Try it like
this:
Like [forms]![MyFormName]![Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [forms]![MyFormName]![Basic_Category]

:

nope..didn't work. :-(

this what I entered:
Like [Me].[Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [Me].[Basic_Category]
(When I saved it, it put in the extra Brackets around Me. and Basic_Category)

This is what I put into the other fields:
Like "*" & [Forms]![QueryFormName]![FieldName] & "*"

:

Refer to the value of the combo box in the query's criteria box

Me.MyCombo

:

New Problem: Is there a way to have the expression in the Query Criteria box
search for values in a pull down list in a Combo Box on the query Form?
I.E. say there are four values in the combo box pull down list ( Cat, Dog,
Fish, Bird). If one of those values is selected (Dog) via the pull down list,
what does the expression have to look like to search for the selected value
(Dog)?
 
K

Klatuu

I really don't know. There is something wrong somewhere, because referencing
a form control in a query is a very common thing and should not be this
difficult.

ryan_eng said:
ok, made that change but still getting the parameter entry pop-up. I made
sure that there is a requery in the After Update event for it. Anything else
I could be missing?

RYAN

Klatuu said:
Your syntax is still incorrect.
[Forms]![frm_Time_Tracking]![frm_Time_Tracking_Details]![Time_Type]
What you want is
[forms]![MainFormName]![SubFormName]![ControlName]

ryan_eng said:
Is there any way I can get you to look at it? I've tried to write the
expression all different ways and it still gives the popup parameter entry.
I'm assuming the problems lie in that the combo box is in a subform, but I'm
pretty sure I covered that with the syntax:
[Forms]![frm_Time_Tracking]![frm_Time_Tracking_Details]![Forms]![Time_Type]
correct me if I'm wrong.

Do I need to simply write the above in the criteria box or am I missing
something? Am I missing something with the After Update requery?

RYAN

:

Without the objects in front of me, I can't tell. I know the examples I sent
work, because I use both versions.

:

I have a similar problem to jwinder.
I have a subform with 3 combo boxes that have to be all related. The first
one is Task_ID, a combo box that grabs a list from another table. The second
is Act_Type, which is just a list I enterred manually. The third is Act_ID,
which is based on a query and needs to be filtered using the values of the
previous two combo boxes. I tried using the expression Klatuu dug up but its
not working. I still get the "enter parameter value" dialog box with the
expression shown.

I really need this to work, pleeeeeease help me.

RYAN


:

Okay, I had to go back and dig out an app I did 6 yrs ago and found the right
syntax. Mine is this:
Like [Forms]![frmClientSearch]![txtLastName] & "*"

So your's should be like this:
Like [Forms]![Query - Catalog Append Table]![Basic_Category] & "*"
:

nope...doesn't work that way either.

:

Should be the name of the combo box. I wonder if because you are using LIKE,
it should be :

Like "'" & [Forms]![Query - Catalog Append Table]![Basic_Category] & "'"

:

nope..still did not work. I now have
Like [Forms]![Query - Catalog Append Table]![Basic_Category]

Should the [Basic_Category] be the field name of the table or the name of
the Combo Box? As it is, it is the name of the Combo Box.

:

hmmmm, I thought I had copied from your post. You only need it one time:
Like [forms]![MyFormName]![Basic_Category]
:

yes...one column. I was just doing what I thought you asked me to do...

you wrote: Like [forms]![MyFormName]![Basic_Category] & [Forms]![Query -
Catalog Append Table]![BasicCategory] & [forms]![MyFormName]![Basic_Category]


:

Now you are up to 3 times. Is this all in the criteria for one column in the
query? It doesn't seem to make any sense.

:

seems llike I have something in there too many times... I now have the
following:
Like [forms]![Query - Catalog Append Table]![Basic_Category] &
[Forms]![Query - Catalog Append
Table]![BasicCategory] & [forms]![Query - Catalog Append
Table]![Basic_Category]

When I run the Query (with no criteria in any of the fields) i get a pop up
box with the title "enter Parameter Value" and below that
"Forms!Query-Catalog Append" then a blank List Box.


:

Like [Me].[Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [Me].[Basic_Category]
I'm curious as to why you have basiccategory in criteria twice. Try it like
this:
Like [forms]![MyFormName]![Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [forms]![MyFormName]![Basic_Category]

:

nope..didn't work. :-(

this what I entered:
Like [Me].[Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [Me].[Basic_Category]
(When I saved it, it put in the extra Brackets around Me. and Basic_Category)

This is what I put into the other fields:
Like "*" & [Forms]![QueryFormName]![FieldName] & "*"

:

Refer to the value of the combo box in the query's criteria box

Me.MyCombo

:

New Problem: Is there a way to have the expression in the Query Criteria box
search for values in a pull down list in a Combo Box on the query Form?
I.E. say there are four values in the combo box pull down list ( Cat, Dog,
Fish, Bird). If one of those values is selected (Dog) via the pull down list,
what does the expression have to look like to search for the selected value
(Dog)?
 
R

ryan_eng

any chance you could have a look at it? I'm really at the end of my rope.

RYAN

Klatuu said:
I really don't know. There is something wrong somewhere, because referencing
a form control in a query is a very common thing and should not be this
difficult.

ryan_eng said:
ok, made that change but still getting the parameter entry pop-up. I made
sure that there is a requery in the After Update event for it. Anything else
I could be missing?

RYAN

Klatuu said:
Your syntax is still incorrect.
[Forms]![frm_Time_Tracking]![frm_Time_Tracking_Details]![Time_Type]
What you want is
[forms]![MainFormName]![SubFormName]![ControlName]

:

Is there any way I can get you to look at it? I've tried to write the
expression all different ways and it still gives the popup parameter entry.
I'm assuming the problems lie in that the combo box is in a subform, but I'm
pretty sure I covered that with the syntax:
[Forms]![frm_Time_Tracking]![frm_Time_Tracking_Details]![Forms]![Time_Type]
correct me if I'm wrong.

Do I need to simply write the above in the criteria box or am I missing
something? Am I missing something with the After Update requery?

RYAN

:

Without the objects in front of me, I can't tell. I know the examples I sent
work, because I use both versions.

:

I have a similar problem to jwinder.
I have a subform with 3 combo boxes that have to be all related. The first
one is Task_ID, a combo box that grabs a list from another table. The second
is Act_Type, which is just a list I enterred manually. The third is Act_ID,
which is based on a query and needs to be filtered using the values of the
previous two combo boxes. I tried using the expression Klatuu dug up but its
not working. I still get the "enter parameter value" dialog box with the
expression shown.

I really need this to work, pleeeeeease help me.

RYAN


:

Okay, I had to go back and dig out an app I did 6 yrs ago and found the right
syntax. Mine is this:
Like [Forms]![frmClientSearch]![txtLastName] & "*"

So your's should be like this:
Like [Forms]![Query - Catalog Append Table]![Basic_Category] & "*"
:

nope...doesn't work that way either.

:

Should be the name of the combo box. I wonder if because you are using LIKE,
it should be :

Like "'" & [Forms]![Query - Catalog Append Table]![Basic_Category] & "'"

:

nope..still did not work. I now have
Like [Forms]![Query - Catalog Append Table]![Basic_Category]

Should the [Basic_Category] be the field name of the table or the name of
the Combo Box? As it is, it is the name of the Combo Box.

:

hmmmm, I thought I had copied from your post. You only need it one time:
Like [forms]![MyFormName]![Basic_Category]
:

yes...one column. I was just doing what I thought you asked me to do...

you wrote: Like [forms]![MyFormName]![Basic_Category] & [Forms]![Query -
Catalog Append Table]![BasicCategory] & [forms]![MyFormName]![Basic_Category]


:

Now you are up to 3 times. Is this all in the criteria for one column in the
query? It doesn't seem to make any sense.

:

seems llike I have something in there too many times... I now have the
following:
Like [forms]![Query - Catalog Append Table]![Basic_Category] &
[Forms]![Query - Catalog Append
Table]![BasicCategory] & [forms]![Query - Catalog Append
Table]![Basic_Category]

When I run the Query (with no criteria in any of the fields) i get a pop up
box with the title "enter Parameter Value" and below that
"Forms!Query-Catalog Append" then a blank List Box.


:

Like [Me].[Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [Me].[Basic_Category]
I'm curious as to why you have basiccategory in criteria twice. Try it like
this:
Like [forms]![MyFormName]![Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [forms]![MyFormName]![Basic_Category]

:

nope..didn't work. :-(

this what I entered:
Like [Me].[Basic_Category] & [Forms]![Query - Catalog Append
Table]![BasicCategory] & [Me].[Basic_Category]
(When I saved it, it put in the extra Brackets around Me. and Basic_Category)

This is what I put into the other fields:
Like "*" & [Forms]![QueryFormName]![FieldName] & "*"

:

Refer to the value of the combo box in the query's criteria box

Me.MyCombo

:

New Problem: Is there a way to have the expression in the Query Criteria box
search for values in a pull down list in a Combo Box on the query Form?
I.E. say there are four values in the combo box pull down list ( Cat, Dog,
Fish, Bird). If one of those values is selected (Dog) via the pull down list,
what does the expression have to look like to search for the selected value
(Dog)?
 

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

Top