Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2007

Tip: Looking for answers? Try searching our database.

unbound checkbox in datasheet view?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LF - 04 May 2007 01:21 GMT
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
expected in form view but not datasheet view.

The checkbox is replicated for each datasheet record as expected, but when a
single records checkbox is clicked all of the records are simultaneously
checked/unchecked (although the code is still correctly applied to only the
current record). Is there a way to control the displayed checkbox
independently for each record without making it a bound control?

Your suggestions are appreciated.

Signature

LF

fredg - 04 May 2007 01:35 GMT
> 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"?
showgie - 10 Jul 2007 07:21 GMT
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.  :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.