simple criteria question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 7 combo boxes each with the same choices of training routine. I want
to have a query that looks at each combo box and chooses the relevant workout
data from the relevant fields. The problem is if one of the criteria is null
it shows no data even though other criteria may match. What is the simple
criteria to put on each of the choices to say, "If no data present for my
argument, ignore me and still display all the oter data that the query finds!"

Does that make sense????? ( I like to think that queries can talk out loud!!)
 
Paul said:
I have 7 combo boxes each with the same choices of training routine. I want
to have a query that looks at each combo box and chooses the relevant workout
data from the relevant fields. The problem is if one of the criteria is null
it shows no data even though other criteria may match. What is the simple
criteria to put on each of the choices to say, "If no data present for my
argument, ignore me and still display all the oter data that the query finds!"

Does that make sense????? ( I like to think that queries can talk out loud!!)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Not sure w/ so little data to go on. Perhaps, this:

WHERE (column_name = ComboBoxName AND ComboBoxName IS NOT NULL) OR
ComboBoxName IS NULL

Substitute something like:

Forms!frmFormName!ComboBoxName

for ComboBoxName. That form has to be open when the query runs.

What this criteria does:

"(column_name = ComboBoxName AND ComboBoxName IS NOT NULL)":
When the ComoBox has a value it will try to compare that value to the
value in column_name.

"ComboBoxName IS NULL":
If the ComboBox doesn't have any value this expression will resolve to
True, which means return all records.

If you create this criteria for all the ComboBoxes the WHERE clause will
return records that only fit the values in the ComboBoxes that have a
value.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQvEnVYechKqOuFEgEQJC6gCeLB7j6u3XQxZh/gGyTU/1phDT7tsAoLJA
5nHFr3rmP4yg5S/uxktEuoIy
=tjCD
-----END PGP SIGNATURE-----
 
How can I get the combo box value to refernce a certain table , for example,
If i choose running programme it enters a 1 ijn the table field, But i have
15 dif types of programme for it to choose from. Once i can get it tyo point
to the right table I can then filter it to the right contactID. Or am ai best
just puytting ALL my programme data inot one huge table to query that?
 
Paul said:
I have 7 combo boxes each with the same choices of training routine. I want
to have a query that looks at each combo box and chooses the relevant workout
data from the relevant fields. The problem is if one of the criteria is null
it shows no data even though other criteria may match. What is the simple
criteria to put on each of the choices to say, "If no data present for my
argument, ignore me and still display all the oter data that the query finds!"

Does that make sense????? ( I like to think that queries can talk out loud!!)


Sorry, but it doesn't make much sense to me. Best I can
make out you might want to try a criteria like:

=Forms!someform.somecombo OR (Forms!someform.somecombo Is
Null)
 
Paul said:
How can I get the combo box value to refernce a certain table , for example,
If i choose running programme it enters a 1 ijn the table field, But i have
15 dif types of programme for it to choose from. Once i can get it tyo point
to the right table I can then filter it to the right contactID. Or am ai best
just puytting ALL my programme data inot one huge table to query that?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

To use the values from a lookup table in the Combo Box you'd use an SQL
SELECT command in the RowSource property (or the name of a query that
does the same thing). Set the RowSourceType to Query/Table. Set the
RowSource property to something like this:

SELECT type_code, type_definition FROM table_name ORDER BY 2

Use your code and definition column names and your table name in place
of the names I used.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQvJb84echKqOuFEgEQIe4gCg8FFFvwa3+krG61iCH4HxvVa6KGQAnioo
1scBBrt9Tv2g/aWJzrIkjeIn
=iAHn
-----END PGP SIGNATURE-----
 
Back
Top