Enable/Disable command button on each record of continuous form

L

Larry Kahm

I have discovered that the VBA I was coding did not do what I wanted, so now
I'm thinking what I want to do may not be possible. I'm looking for
suggestions.

In a continous form of company records, I have a checkbox that indicates
when additional locations exist. There is a command button next to that
which displays a list of the additional locatoins for that company. I'd
like the command button to be enabled/active if the checkbox has a value,
but disabled/inactive when the checkbox has no value.

Is this possible? If so, I'm sure I'm missing something simple.

Thanks!

Larry
 
T

Tony Toews [MVP]

Larry Kahm said:
I have discovered that the VBA I was coding did not do what I wanted, so now
I'm thinking what I want to do may not be possible. I'm looking for
suggestions.

In a continous form of company records, I have a checkbox that indicates
when additional locations exist. There is a command button next to that
which displays a list of the additional locatoins for that company. I'd
like the command button to be enabled/active if the checkbox has a value,
but disabled/inactive when the checkbox has no value.

Is this possible? If so, I'm sure I'm missing something simple.

No, this isn't possible on a continuous form. We wish it was but it's
not. What I do though as a work around is if the check box is false
and the user clicks on the button is display a meaningful message.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
G

Graham Mandeno

Hi Larry

Unfortunately this is not possible on a continuous form. A control on a
continuous form is actually many instances of the same control. It is not
possible for these different instances to have different properties.

One way to make this *appear* to happen is to create a textbox, locked and
disabled, that *looks* like a command button (raised effect etc). Use
conditional formatting to change the ForeColor of the textbox to light grey
when the checkbox has no value.

Then make your command button transparent and position it over the top of
the textbox. Of course, your command button's Click event will also have to
enquire the state of the checkbox and do nothing if it has no value.
 

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