Mr. B said:
One possible solution is to declare a public variable as byte type.
Initilize this variable to zero when your form opens. Then use code in the
after update event of each of your check boxes like:
If me.NameOfCurrentCheckBox = true then
YourNewVariable = YourNewVariable + 1
else
YourNewVariable = YourNewVariable - 1
end if
If YourNewVariable = 12 then
Me.NameOfUpdateButton.Enable = true
else
Me.NameOfUpdateButton.Enable = false
end if
The code above is "air code" and is not tested.
This solution assumes that all check boxes are always uncheck when the form
opens.
-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm
Mr. T.B.,
I give myself poor advice at times also. I think your proposed solution
has some potential weaknesses. For example, you have minimal protection
against your count staying synchronized with the checkboxes. Since
you're using the AfterUpdate event for each checkbox anyway, why not
just call a Boolean function (behind the form) that looks at the actual
state of the checkboxes. As soon as it sees any that are not checked,
it can exit the function early and return False.
BTW, I'm aware that your actual surname is of ancient Scottish ancestry,
predating even the Norman Invasion (1066), when many of the British
surnames in common use today were created, by at least four centuries.
I checked on the Fortune name when I visited Edinburgh. Someone named
Fortune lived briefly in Scotland around 1100, but there was never a
Fortune Clan of any kind in Scotland AFAICT. But that doesn't mean I
don't have some notorious ancestors.
According to cousins related to me by my maternal grandfather, I am
apparently directly related to a cousin of Kaiser Wilhelm II, which
opens up a whole other can of notoriety.
Based on the fact that my paternal grandfather and his brother moved to
Michigan from Virginia to start a paper mill like the one they had on
the James River, and from his stories, I am directly related to the
Fortune family of Virginia descended from a settler who arrived in
Virginia from Wales in the early 1700's. That family had a couple of
generations of brother/sister marriages, so 'd have to classify my
paternal ancestors as rednecks
. According to my research, nearly
all the people with the surname Fortune in the U.S., i.e., those where
the family did not acquire the surname later, are related to that common
ancestor. My maternal ancestors were the result of a family line of
revolutionaries and a family line of royalists eventually meeting as
they migrated west. A couple of my ancestors came to the U.S. as a
result of the Irish Potato Famine circa 1850. Given the duplicity of
the famous botanist named Fortune
http://en.wikipedia.org/wiki/Robert_Fortune
who snuck into China pretending to be Chinese when Europeans weren't
allowed, in order to smuggle out botanical samples, not to mention
Fortune family activities designed to keep moonshine from Revenuers
during Prohibition along the James River, I'm not the best one to
criticize your actions. There was even an industrial magnate named
Fortune on the Titanic who perhaps inspired the bad guy in the movie
.
James A. Fortune
(e-mail address removed)
One of your ancestors was drinking heavily with Henry Ford Jr. in
northern Michigan. Henry Ford Sr., being a teetotaler, didn't
appreciate that his son liked to get drunk. They both got pretty wasted
and Henry Ford Jr. accidentally ran over his leg with an early
automobile and broke it. He was so drunk I doubt he even felt it. My
brother James Heacock, was an executive at Ford's until he died in the
90's. -- My grandfather
Note: People from Michigan usually say Ford's instead of Ford.