From: Alan on
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 ???
From: Jeanette Cunningham on
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

"Alan" <Alan(a)discussions.microsoft.com> wrote in message
news:0E53686B-7520-4076-AC38-76011A564792(a)microsoft.com...
> 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 ???


From: Alan on
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


"Jeanette Cunningham" wrote:

> 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
>
> "Alan" <Alan(a)discussions.microsoft.com> wrote in message
> news:0E53686B-7520-4076-AC38-76011A564792(a)microsoft.com...
> > 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 ???
>
>
> .
>
From: Alan on
Scrap that i just had to modify it a bit

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

"Jeanette Cunningham" wrote:

> 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
>
> "Alan" <Alan(a)discussions.microsoft.com> wrote in message
> news:0E53686B-7520-4076-AC38-76011A564792(a)microsoft.com...
> > 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 ???
>
>
> .
>