Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 20th, 2009, 08:11 AM
Authorized User
 
Join Date: Nov 2008
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via MSN to MonkeyMan666
Default BIT value not changing on Check Box

Hiya,

I have an Access Project file in 2003 format which is linking to a SQL Server 2005 database. In one of the tables there are fields with BIT datatypes with a default value of 0. On the form I am using check boxes for these fields but they arent updating.

I can change the value from false to true but not the other way round, it seems to be stuck on true.

There is no code being fired after the update and I am getting no warnings saying the recordset is not updateable.

Does anyone have any ideas what may be causing the problem?

Thanks in advance
 
Old March 20th, 2009, 08:14 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hello, can you debug your code?? I don't remember access specific, but some VB version use 0 and -1 for boolean values (and -1 is not valid in a BIT field). Maybe you are sending the wrong data to it?
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
The Following User Says Thank You to gbianchi For This Useful Post:
MonkeyMan666 (March 20th, 2009)
 
Old March 20th, 2009, 08:50 AM
Authorized User
 
Join Date: Nov 2008
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via MSN to MonkeyMan666
Default

There is no VBA code specific to the controls I am setting the data source through the object properties.

Never thought of that, I knew Access had a silly way of dealing with boolean values. I shall try setting the value programmatically and see if that works, I shall let you know how I get on,

Thanks
 
Old March 20th, 2009, 09:25 AM
Authorized User
 
Join Date: Nov 2008
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via MSN to MonkeyMan666
Default

Yes that works a treat.

Thank you :)
 
Old March 20th, 2009, 09:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

no prob. :)
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old March 23rd, 2009, 06:19 AM
Authorized User
 
Join Date: Nov 2008
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via MSN to MonkeyMan666
Default

Hiya,

On second thoughts it doesnt seem to be working. I can change the checkbox but when I want to update the value through code it doesnt seem to work. My code is as follows:

Code:
If Forms!frmInfoChange.chkStaff = True Then
        Forms!frmInfoChange!Staff = 1
    Else
        Forms!frmInfoChange!Staff = 0
    End If
I have also read this somewhere that this could be a problem with Office SP3, has anyone had similar problems?

Thanks
 
Old March 23rd, 2009, 06:32 AM
Authorized User
 
Join Date: Nov 2008
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via MSN to MonkeyMan666
Default

This is a known problem and more details can be found at:
http://support.microsoft.com/default...=rss&spid=2509

I have installed the patch and it now works fine.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Check BOx kaushikpulpa ASP.NET 2.0 Professional 2 August 30th, 2007 08:01 AM
64 Bit - Issue in 64 bit IIS calling Win32 API Hubman General .NET 1 August 24th, 2006 09:19 AM
Changing font in dropdown box Bjoe HTML Code Clinic 4 April 24th, 2006 01:34 PM
please help (get check box value) qadeerahmad General .NET 3 September 24th, 2004 08:46 AM
how to get value from check box..... cici Classic ASP Professional 2 May 15th, 2004 08:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.