> I have a form with a single unbound checkbox with code behind it's
> AfterUpdate event that updates the value of a bound field; this works as
[quoted text clipped - 7 lines]
>
> Your suggestions are appreciated.
That's not how you do it.
You need to first add a new check box field to your underlying table.
Then add it to the form so that it is BOUND to that field in the
table. No Update code needed.

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
LF - 04 May 2007 18:26 GMT
I didn't think I could modify a system table.

Signature
LF
> > I have a form with a single unbound checkbox with code behind it's
> > AfterUpdate event that updates the value of a bound field; this works as
[quoted text clipped - 12 lines]
> Then add it to the form so that it is BOUND to that field in the
> table. No Update code needed.
Rick Brandt - 04 May 2007 18:29 GMT
> I didn't think I could modify a system table.
Who said anything about a "system table"?
I'm not sure about the whole "system table" thing, but I do know that I had a
similar situation, where I could not modify the table to add a field because
there was a ton, ton, ton of spaghetti code in my (not written by me)
application that would have broken if I modified one of my core table
definitions.
This is going to sound stupid, but it did work. I made a new table with two
fields. One was the key field of the table I was actually interested in
being able to "flag" records in (and I made it my primary key). The other
was just a boolean field (I called it "include".)
I made the form run on a query with a left-join to the new table, so I could
have the field "include" in my form's recordset.
When I loaded my form, I ran an append query (warnings turned off) to add the
form's displayed records key field to the above-referenced table (it would
skip any record already in there, based on the primary key violation.) Then,
since I wanted the default to be "Y", I updated all the records to "Y".
Then I could use that new field in the form, as a checkbox in my datasheet,
and it behaved correctly. To make this solution work in a more dynamic multi-
user environment, I'd have to spend even more time on it, since at this point,
a second user could flag the "include' field to "Y" while the first user was
trying to use the data. But mine's a single-user database.
I'm really sleepy, so I hope this makes sense. It took me forever to figure
out, so I figured I should post it on this thread, since it was one of many I
read looking for someone else to solve my problem. :-)