Enabling & Disabling Form Controls

  • Thread starter Thread starter jody
  • Start date Start date
J

jody

I've been trying to use conditional formatting on my form
but have not been able to get it to work the way I want it
to.

I have two sections for the user to choose from to fill in
information: 1) Current Customer (the user selects the
current customer ID from a drop down box) or 2) New
Customer (the user can enter a new customer or prospect,
filling in the CompanyName, address, city, etc).

If the Current Customer control is selected, I want the
new customer section (CompanyName, address, city, etc) to
be disabled. But then, if the New Customer section is
filled in, I want the Current Customer (drop down box) to
be disabled. The user can select one or the other but NOT
BOTH.

Since I'm not very proficient at VB, I was trying to work
this through the conditional formatting option in Access.

Would appreciate any suggestions. Thanks in advance....
 
Jody wrote...
-----Original Message-----
I've been trying to use conditional formatting on my form
but have not been able to get it to work the way I want it
to.

I have two sections for the user to choose from to fill in
information: 1) Current Customer (the user selects the
current customer ID from a drop down box) or 2) New
Customer (the user can enter a new customer or prospect,
filling in the CompanyName, address, city, etc).

If the Current Customer control is selected, I want the
new customer section (CompanyName, address, city, etc) to
be disabled. But then, if the New Customer section is
filled in, I want the Current Customer (drop down box) to
be disabled. The user can select one or the other but NOT
BOTH.

Since I'm not very proficient at VB, I was trying to work
this through the conditional formatting option in Access.

Would appreciate any suggestions. Thanks in advance....
.


Jody,

I would use the AfterUpdate event for your controls.

On the CurrentCustomer combo box AfterUpdate event you can:

me.Companyname.Enabled = false
me.Address.Enabled = false
etc...

On the New Customer control do the opposite.

me.CompanyName.Enabled = true
me.Address.Enabled = True
etc...


hth
Ivan

alovercast @ hayoo.com
 
Thanks, Ivan.

The Current Customer combo box is pretty easy. I'm not
sure about the "New Customer" section though. Do I use
the AfterUpdate event for each of the controls --
CompanyName, CompanyAddr, CompanyCity, CompanySt, etc? I
don't have one control called New Customer. They are all
individual text fields.
-----Original Message-----
Jody wrote...
-----Original Message-----
I've been trying to use conditional formatting on my form
but have not been able to get it to work the way I want it
to.

I have two sections for the user to choose from to fill in
information: 1) Current Customer (the user selects the
current customer ID from a drop down box) or 2) New
Customer (the user can enter a new customer or prospect,
filling in the CompanyName, address, city, etc).

If the Current Customer control is selected, I want the
new customer section (CompanyName, address, city, etc) to
be disabled. But then, if the New Customer section is
filled in, I want the Current Customer (drop down box) to
be disabled. The user can select one or the other but NOT
BOTH.

Since I'm not very proficient at VB, I was trying to work
this through the conditional formatting option in Access.

Would appreciate any suggestions. Thanks in advance....
.


Jody,

I would use the AfterUpdate event for your controls.
 
Jody,

The only after update you need to do is for the very
first thing the user has to enter to create a "New
Customer". If you want you can set the ON LOAD for the
form to set the critical items to <item>.enable = false.
Then once the user enters the necessary information to
start a new customer you can, in the AfterUpdate event for
that control, re-enable the items.

I hope this makes sense. If not, give me a mail (with
a slimed down version of your db and form if you want) and
we can take this discussion further if you wish.


Ivan

alovercast @ yahoo. com
-----Original Message-----
Thanks, Ivan.

The Current Customer combo box is pretty easy. I'm not
sure about the "New Customer" section though. Do I use
the AfterUpdate event for each of the controls --
CompanyName, CompanyAddr, CompanyCity, CompanySt, etc? I
don't have one control called New Customer. They are all
individual text fields.
 
Back
Top