Show ALL values

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

Guest

Hi there,

I have a combo box with three choices 'ALL, DOMESTIC, IMPORT'. I want to
run a query based on the option selection.

'Import' and 'Domestic' work great, but how can I get all values to show
when 'ALL' is chosen?

Many thanks.
 
Carlee said:
Hi there,

I have a combo box with three choices 'ALL, DOMESTIC, IMPORT'. I
want to run a query based on the option selection.

'Import' and 'Domestic' work great, but how can I get all values to
show when 'ALL' is chosen?

Many thanks.

How is the query set up? Does it explicitly refer to the combo box as a
criterion in its WHERE clause? Please post the SQL of the query.
 
Hi there,

I have a combo box with three choices 'ALL, DOMESTIC, IMPORT'. I want to
run a query based on the option selection.

'Import' and 'Domestic' work great, but how can I get all values to show
when 'ALL' is chosen?

Many thanks.

sub MyCombo_Afterupdate()

select case MyComboBox
case="Domestic"
SQL=........ WHERE Domestic=true
case="Import"
SQL=........ WHERE Import=true
case else
SQL=..... 'without Where
end select

currentDb.execute SQL,dbfailOnError

end sub
 
Hi, Carlee.

How are you "running a query"? Is the selection to then populate another
combo box? Please provide more detail.

Sprinks
 
Hi there,

I have a combo box with three choices 'ALL, DOMESTIC, IMPORT'. I want to
run a query based on the option selection.

'Import' and 'Domestic' work great, but how can I get all values to show
when 'ALL' is chosen?

Many thanks.

A criterion on the field such as

= [Forms]![yourformname]![comboboxname] OR
[Forms]![yourformname]![comboboxname] = "ALL"

will do it.

John W. Vinson[MVP]
 
Hi there,

The query is set up such that in the criteria row of the 'DomesticImport'
field, i have Forms!frmQueryBuild!cboDomImp

Problem: I don't have a value in my record set as "ALL". I want "ALL"
there such that if the user wants all values, he/she can, not just domestic
or import.

Thank you for your help.
 
Carlee said:
Hi there,

The query is set up such that in the criteria row of the
'DomesticImport' field, i have Forms!frmQueryBuild!cboDomImp

Problem: I don't have a value in my record set as "ALL". I want
"ALL" there such that if the user wants all values, he/she can, not
just domestic or import.

John Vinson's reply tells you how to change your query's criterion to
make this work, then.
 
Back
Top