Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old March 20th, 2008, 07:49 AM
Newbie
 
Join Date: Mar 2008
Posts: 4
Default Default value in checkbox changes when entering new line

Hello!

I have a form in datasheet view with checkboxes. One of them is called Cancelled. In the SQL table it is a bit value.

When a user keys in a line, the checkbox should be default unchecked unless he/she checks it.

So what I have done is to set the default value to False (have tried 0 as well)
and in the bottom row (the add new line row) this box is shown to be unchecked.

But once I key in any data in the row, the checkbox immediately auto checks itself.

Any idea what I need to check to find the source of this problem??

Appreciate any help!! :)
Reply
  #2  
Old March 20th, 2008, 07:53 AM
Expert
 
Join Date: Jan 2008
Age: 44
Posts: 346
Default

I'm assuming from what you've wrote that since you've mentioned the SQL Word, that you're either using MS SQL or some other SQL Backend other than MS Access? If that is true. you need to change the table definition to Integer with a value of 0 for false and -1 for the value of true. anything else will always evaluate to true. This is why you're getting the checked box, because access is evaluating the value in the Bit field as true. Just change the field type from Bit to Integer and change the value to 0 for false.
Reply
  #3  
Old March 26th, 2008, 09:22 AM
Newbie
 
Join Date: Mar 2008
Posts: 4
Default

Hi!

Sorry for the late reply... Just managed to get back on this task again.
I totally understand what you mean and thank you for explaining it to me. Yes, I am using MS SQL.

I tried doing what you said and changed that column from bit to smallint (am i right?) however, I dont know how to default 0 to false as you said (I am using MS SQL Management Studio) Or is it done using SQL code?

appreciate the help! thanks ;)
Reply
  #4  
Old March 26th, 2008, 02:10 PM
FishVal's Avatar
Expert
 
Join Date: Jun 2007
Location: Israel
Age: 32
Posts: 2,034
Default

Quote:
Originally Posted by gurge
......
So what I have done is to set the default value to False (have tried 0 as well)
and in the bottom row (the add new line row) this box is shown to be unchecked.

But once I key in any data in the row, the checkbox immediately auto checks itself.
......
Are you sure there is no code running on Current event in the form?
Reply
  #5  
Old March 28th, 2008, 08:21 AM
Newbie
 
Join Date: Mar 2008
Posts: 4
Default

Hi all...

Seems after a TON of googling, my issue was exactly this:

http://thesource.ofallevil.com/commu...r=US&sloc=&p=1

after a hotfix, it works fine now.

Thanks alot for all the help ;)

Last edited by Stewart Ross Inverness; March 28th, 2008 at 08:59 AM. Reason: hyperlinked reference
Reply
  #6  
Old March 28th, 2008, 09:02 AM
Newbie
 
Join Date: Mar 2008
Location: Portland, Oregon
Posts: 19
Default

Quote:
Originally Posted by gurge
Hi all...

Seems after a TON of googling, my issue was exactly this:

http://thesource.ofallevil.com/commu...r=US&sloc=&p=1

after a hotfix, it works fine now.

Thanks alot for all the help ;)

Hey, your link didn't work and I'm really curious about this. Would you mind explaining the gist of it?
Reply
  #7  
Old March 28th, 2008, 09:13 AM
Newbie
 
Join Date: Mar 2008
Posts: 4
Default

Hmm yea... its kind of a weird URL...(funny as well) the site is actually the microsoft forums tho.

Hope its okay to copy and paste what it said...

Quote:
I have Access 2003 and SQL Server 2000. Lately I noticed when I add a new
record, all of the bit (check box) feilds deault to True instead of False. i
have made sure w/i Enterprise Manager the defualt is 0, I also did this with
in Access, property
field default value to 0. I did some research and one reply on
Microsoft.public.access was that this is a known bug that has been introdued
by 2003 sP3 and MS is aware if this problem. Do you know if this problem has
been fixed? How do I determine that? (I tried looking for a fix) Does anyone
know of a work around?

Below is the website where I found the response. http://groups.google.com/group/micro.../browse_thread
/thread/474a73bca0883a15/cfe98fa5112528fa?lnk=st&q=access+sp3+adp+bit&rnum= 9

Thanks
ToniS
Quote:
Answer

Toni,
Description of the Access 2003 post-Service Pack 3 hotfix package:
December 18, 2007
http://support.microsoft.com/kb/945674
Jeanette Cunningham
Its basically due to the combi of having Office 03 and SP3. and Microsoft has recognised this problem:
http://support.microsoft.com/kb/945674
and created a hotfix for it.

Do let me know asap if its NOT okay to copy the other forum's thread here. :)

Hope this helped anyone!

Last edited by gurge; March 28th, 2008 at 09:15 AM. Reason: split URL in quotes into half, was elongating the page
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles