Making a combo box enable for two case

A

Alan

i Have a combo box name Cbmonth

when click a specific case i.e. month sales the box enables,

Me.cbMonth.Enabled = (SalesPeriod = byMonth)

what i need is when we i select Sales person case i need the cbmonth to
enable

i've tried this

me.cbmonth.enabled= (SalesPeriod = byMonth and BySalesPerson) but it doesn't
work

Any ideas anyone ???
 
J

Jeanette Cunningham

Write it like this:

me.cbmonth.enabled= (Me.SalesPeriod = "byMonth" Or Me.SalesPeriod =
"BySalesPerson")

Note: I am assuming that SalesPeriod is a bound control on your form and
that it has text data type.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
A

Alan

No The sales period is just a look up for a list box,

i have a list box that got

yearly
monthly
quarterly
Sales Person

which are different reports

so when i click on yearly the yearly combo box enables
when i click on quartery the yearly and quarter box enable an so on

i just need some code so that if i click on monthly or sales person they
enable the yearly combo and the monthly one all i get at the moment is the
yearly one with the sales person
 
A

Alan

Scrap that i just had to modify it a bit

Me.cbMonth.Enabled = (SalesPeriod = byMonth Or SalesPeriod = BySalesPerson)
Thanks for you help
 

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