combobox criteria for parameter query

  • Thread starter Thread starter ed
  • Start date Start date
E

ed

I have a parameter query that gets its criteria from many
fields, including a combobox. I have tried the folowing
expression (Like [Forms]![Oligo Query]![Combo25].[Text] Or
IsNull) to serve as the criteria for the query, however I
never get any records returned. Please help. Thanks.
 
Ed,

Omit the .[Text] part at the end, i.e. change your criterion to:

Like [Forms]![Oligo Query]![Combo25].[Text] Or IsNull

HTH,
Nikos
 
Don't know what version of Access you are running, or where this code is
located, but I don't think you can reference the combo boxes text property
unless that is the active control. You might want to try:

Like Forms![Oligo Query]![Combo25].Value & "*"

or, since the Value property is the default for a combo box, you could just
write:

Like Forms![Oligo Query]![Combo25] & "*"

This will allow you to enter any of number of characters to search for and
it would filter all records that start with that set of characters.

HTH
Dale

Nikos Yannacopoulos said:
Ed,

Omit the .[Text] part at the end, i.e. change your criterion to:

Like [Forms]![Oligo Query]![Combo25].[Text] Or IsNull

HTH,
Nikos

ed said:
I have a parameter query that gets its criteria from many
fields, including a combobox. I have tried the folowing
expression (Like [Forms]![Oligo Query]![Combo25].[Text] Or
IsNull) to serve as the criteria for the query, however I
never get any records returned. Please help. Thanks.
 
I appreciate all the help. I have tried to enter the all
three suggestions and I am still getting zero results from
my search. I am using criteria that matches data in my
table. Also removing the combobox reference returns my
query to normal behavior. Does it matter that the source
for the combobox is from a table other than the one that
is the source for the query? Thanks again.

-----Original Message-----
Don't know what version of Access you are running, or where this code is
located, but I don't think you can reference the combo boxes text property
unless that is the active control. You might want to try:

Like Forms![Oligo Query]![Combo25].Value & "*"

or, since the Value property is the default for a combo box, you could just
write:

Like Forms![Oligo Query]![Combo25] & "*"

This will allow you to enter any of number of characters to search for and
it would filter all records that start with that set of characters.

HTH
Dale

Ed,

Omit the .[Text] part at the end, i.e. change your criterion to:

Like [Forms]![Oligo Query]![Combo25].[Text] Or IsNull

HTH,
Nikos

I have a parameter query that gets its criteria from many
fields, including a combobox. I have tried the folowing
expression (Like [Forms]![Oligo Query]![Combo25]. [Text] Or
IsNull) to serve as the criteria for the query, however I
never get any records returned. Please help. Thanks.


.
 
Ed,

It doesn't, as long as the combo returns the right string.
By the way, are you sure it returns what you think? Combos can be setup so
the value they return is not what you see, for instance you might be seeing
Florida on screen, while the vombo returns FL!
To make sure, open the immediate window (Ctrl+G), and while your form is
open, type in
?Forms![Oligo Query]![Combo25]
and hit enter, to see what value is returned.

HTH,
Nikos


ed said:
I appreciate all the help. I have tried to enter the all
three suggestions and I am still getting zero results from
my search. I am using criteria that matches data in my
table. Also removing the combobox reference returns my
query to normal behavior. Does it matter that the source
for the combobox is from a table other than the one that
is the source for the query? Thanks again.

-----Original Message-----
Don't know what version of Access you are running, or where this code is
located, but I don't think you can reference the combo boxes text property
unless that is the active control. You might want to try:

Like Forms![Oligo Query]![Combo25].Value & "*"

or, since the Value property is the default for a combo box, you could just
write:

Like Forms![Oligo Query]![Combo25] & "*"

This will allow you to enter any of number of characters to search for and
it would filter all records that start with that set of characters.

HTH
Dale

Ed,

Omit the .[Text] part at the end, i.e. change your criterion to:

Like [Forms]![Oligo Query]![Combo25].[Text] Or IsNull

HTH,
Nikos

I have a parameter query that gets its criteria from many
fields, including a combobox. I have tried the folowing
expression (Like [Forms]![Oligo Query]![Combo25]. [Text] Or
IsNull) to serve as the criteria for the query, however I
never get any records returned. Please help. Thanks.


.
 
Back
Top