G
Guest
I apologize for my ignorance. but I'm doing this for the first time and need
the advice of someone in the know.
I'm creating the frmSales based on qrySales. My sales revenues are based on
either (not both) city or county populations. Hence, every sale created by
my form will be assigned to a population bracket to provide a base price
multiple once I've chosen either the [City] or [County] comboboxes on my
form. One of those two fields will ALWAYS be null. The [PopulationBracket]
field to ultimately be populated by my choice resides only on qrySales, not
on the form. Here's the code (I think it's correct, but if you think
otherwise I'd appreciate the correction) which gets part of the job done:
SELECT IIf((Nz(CountyPopulation, CityPopulation)
Between 1 and 20000, 1,)
IIf(Nz(CountyPopulation, CityPopulation)
Between 20001 and 40000, 1.5,)
IIf(Nz(CountyPopulation, CityPopulation)
Between 40001 and 100000, 2.5,)
IIf(Nz(CountyPopulation, CityPopulation)
Between 100001 and 200000, 3,)
IIf(Nz(CountyPopulation, CityPopulation)
Since the result goes into: qrySales!PopulationBracket, my question is where
do I most effectively place the code (an event proceedure after the City or
County decision has been made?) and how do I complete the snippet so that the
result ends up in the right place? Hope someone can help. Thanks.
the advice of someone in the know.
I'm creating the frmSales based on qrySales. My sales revenues are based on
either (not both) city or county populations. Hence, every sale created by
my form will be assigned to a population bracket to provide a base price
multiple once I've chosen either the [City] or [County] comboboxes on my
form. One of those two fields will ALWAYS be null. The [PopulationBracket]
field to ultimately be populated by my choice resides only on qrySales, not
on the form. Here's the code (I think it's correct, but if you think
otherwise I'd appreciate the correction) which gets part of the job done:
SELECT IIf((Nz(CountyPopulation, CityPopulation)
Between 1 and 20000, 1,)
IIf(Nz(CountyPopulation, CityPopulation)
Between 20001 and 40000, 1.5,)
IIf(Nz(CountyPopulation, CityPopulation)
Between 40001 and 100000, 2.5,)
IIf(Nz(CountyPopulation, CityPopulation)
Between 100001 and 200000, 3,)
IIf(Nz(CountyPopulation, CityPopulation)
FROM QrySales200001, 3.5)) As Result
Since the result goes into: qrySales!PopulationBracket, my question is where
do I most effectively place the code (an event proceedure after the City or
County decision has been made?) and how do I complete the snippet so that the
result ends up in the right place? Hope someone can help. Thanks.