Multiple item Form

gry086

New member
Local time
Today, 06:03
Joined
May 4, 2011
Messages
7
Access 2007 Multiple item forms are fantastic. They have been the number 1 tool for meeting my clients needs, so far.

Despite all my praise, there is a trouble I run into from time to time. I can't seem to use VBA to change just 1 item in the form.

For instance, the form currently shows several table entries on one page, each entry (or row of the form) has a text field and a button. I want the button for only the currnent row to become disabled after one click. Buttons on the other rows need to remain enabled, until they are clicked, and then become disabled.

To accomplish this, I wrote a little VBA. On the Click event I added
// take focus away from the button- it can't be disabled AND have focus.
Me.text_field.SetFocus
// disable the button
Me.button.enabled = False


As you can imagine- every button on every row of my multiple form becomes disabled.

Any ideas?
*note- I know I could save a flag to identify 'enabled/disabled' in the table.
I do not want to do this.
 
...I know I could save a flag to identify 'enabled/disabled' in the table.
I do not want to do this.
Then I suspect you're out of luck! How do you think the Access Gnomes are going to know whether or not the button on a particular record has been clicked? What happens when this button is clicked? Does it change anything in the record that could be used as a condition for enabling/disabling the button?

Linq ;0)>
 
ok, here's a radical thought. What if you defined a table with each element as a number (integer) entry. Enter a number 1 as the field entry for each element. Do not set an autonumber or key. Then built a query from the table. Then link each button to each specific field in the query, and on each click, multiply the table entry by -1. So each click turns it on or off, as the table entry switches between 1 and -1. The table would store and hold the value. Then you could define autoformating on the button by using a color so you know if it's on or off.

You could then define code in such a way that if the table result =1 or -1 it will provide the result you want.

You might need to evaluate whether the number of clients would preclude this type of work, but suspect this thought might provoke a better coded solution.

Good Luck
 

Users who are viewing this thread

Back
Top Bottom