473,804 Members | 3,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Default value in checkbox changes when entering new line

4 New Member
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!! :)
Mar 20 '08 #1
6 3540
PianoMan64
374 Recognized Expert Contributor
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.
Mar 20 '08 #2
gurge
4 New Member
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 ;)
Mar 26 '08 #3
FishVal
2,653 Recognized Expert Specialist
......
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?
Mar 26 '08 #4
gurge
4 New Member
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 ;)
Mar 28 '08 #5
Fiddler2
19 New Member
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?
Mar 28 '08 #6
gurge
4 New Member
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...

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.publi c.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/474a73bca0883a1 5/cfe98fa5112528f a?lnk=st&q=acce ss+sp3+adp+bit& rnum=9

Thanks
ToniS
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!
Mar 28 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
16185
by: Sarah West | last post by:
Hi, I have the following problem; This is my form, i would like to default the select box to USA, and default the text field to a name such as 'Sarah' and the hidden field to another number like '876543', when the user clicks on the check box, otherwise the fields should be blank, the value of the select box dosnt matter much, only that it defaults to USA, when the user checks it. Can anyone help? i have tried a google with no luck,...
4
4632
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input type="checkbox" name="chk_Complete" value="<%Response.Write l_IsChecked%>"<%if cbool(l_IsChecked) then Response.Write " checked"%>> The code to captures the checkbox value in the asp page that builds the sql string is follows
2
1874
by: David Mitchell | last post by:
I have a multiuser database which VBA to return the current users NT logon. The database has a table which contains the names of all users and a field called bmlogon which holds their NT logon. The database is used to track admin tasks. to add a new task the user first selects the type and then clicks a command button to go to the form for entering the details. The on current property of the main form (for entering details) takes the...
12
5183
by: Phoe6 | last post by:
The Program Fragment is this: int choice; /* Users Input Command */ .. .. .. printf("Enter a command: "); fflush(stdin); choice = getc(stdin); printf("\n");
3
4493
by: Marc Castrechini | last post by:
I have a page that changes an <ASP:Checkbox value based on a user entered value in a textboxm using client side Javascript. After my submit is fired the value for the chkMyCB.checked does not get the latest value of the checkbox. Does this sound like a posibility and if so how can I force the server to get the new value from the page? TIA,
4
3952
by: SJ | last post by:
Hi all, I have come across a weird problem when attempting to automatically set the focus in a vb.net form to a checkbox control... In my form I have (on a tab page in a tab control) several textboxes and a checkbox. The behaviour I want from my app is as follows:- When the textbox (which is prior in tab order to the tab control) has been filled with a certain length of text by the user, the focus is
2
9056
by: Gary Homewood | last post by:
Where can I specify a default value for a column when using a FormView? Specifically, I have a checkbox for a column of bit datatype on my database, and I'd like to default it to checked for insert of a new row. Thanks, Gary
2
5426
by: mudman04 | last post by:
Hi, I searched online for some similar issues that I am facing but was not able come up with anything. I am fairly new with Access (2 months experience) and I am trying to remove a message stating, ENTER PARAMETER VALUE when I am generating a report. I know that the culprit lies in the query stored in the report. I have entered data in the CRITERIA (entered forms!frmproducts!lngproductID) window and OR (entered...
12
12139
by: Doogie | last post by:
How do I make a value the default value for a combo box in ASP 3.0? What I have below does NOT work, yet I've seen it in HTML file examples before (and works if I put it in a HTML file by itself, but not if I use it in a ASP 3.0 app. <select name="cboCompany" style="text-align:right; font-size:8pt"> <option value="08">08</option> <option value="09" selected="true">09</option> <option value="33">33</option>
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9582
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9157
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7621
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5652
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.