Checkbox on bound form sets value to -1 for True 
Author Message
 Checkbox on bound form sets value to -1 for True
Access' standard checkbox sets a "checked" checkbox to -1 for True and 0 for
False or unchecked.  SQL Server wants to see a 1 for True.

Does anyone have a way to make the checkbox set the value of the bound
column to 1 when the checkbox is checked instead of -1?

- Ken



Sun, 16 May 2004 01:40:52 GMT
 Checkbox on bound form sets value to -1 for True

This normally isn't a problem because Jet translates the value for you when
working with SQL Server.
Can you be more specific as to the problem? .mdb or .adp? Linked tables?
--
Joe Fallon
Access MVP


Quote:
> Access' standard checkbox sets a "checked" checkbox to -1 for True and 0
for
> False or unchecked.  SQL Server wants to see a 1 for True.

> Does anyone have a way to make the checkbox set the value of the bound
> column to 1 when the checkbox is checked instead of -1?

> - Ken



Sun, 16 May 2004 07:08:16 GMT
 Checkbox on bound form sets value to -1 for True
I should have explained more before...

My problem is with an .adp in Access 2000.

I can use a bit datatype in a continuous form in the table with proper
results: if I bind a checkbox to a bit column, the checkbox works fine and
sets the underlying value to 0 or 1 as expected.  The problem comes in when
I bind a checkbox to a smallint or int datatype column on a subform of a
main form that is unbound.  Why would I do this you might ask?  In my
continuous sub-form bound to a SQL statement with a single join and the
uniquetable property set to the table with the checkbox's bound column, if
you use a checkbox bound to a bit datatype, you will get the unfriendly
error message: "Write Conflict"  "The record has been changed by another
user since you started editing it......"  This message is referenced in
Knowledge base article Q280730 but for different circumstances (i.e. linked
tables to SQL Server)  I have tried all the workarounds suggested and they
don't make any difference in the behavior.

I am trying an int or smallint type in the hope the "Write Conflict" will go
away but as I write this, I realize the real solution is to solve the "Write
Conflict" problem and stick with the bit datatype for True/False columns.

To make matters stranger, I have created a test table with all three
datatypes (bit, smallint, int) bound a continuous form to a SQL statement
with a single join and ran the form as a main continuous form and it works
fine!  So does it have to do with the fact that the other situation was a
subform?

So, to restate my need:  What datatype for the column and what technique do
I use to create a continuous form, bound to a single table in an .adp using
SQL Server 2000, Access 2000 where I can get standard SQL Server 1 and 0
values for false and true (to maintain compatibility and standardization)
with a bound checkbox and avoid any "Write Conflict" error messages?

I hope you followed this.

Any insights would be appreciated.

- Ken Madland


Quote:
> This normally isn't a problem because Jet translates the value for you
when
> working with SQL Server.
> Can you be more specific as to the problem? .mdb or .adp? Linked tables?
> --
> Joe Fallon
> Access MVP



> > Access' standard checkbox sets a "checked" checkbox to -1 for True and 0
> for
> > False or unchecked.  SQL Server wants to see a 1 for True.

> > Does anyone have a way to make the checkbox set the value of the bound
> > column to 1 when the checkbox is checked instead of -1?

> > - Ken



Sun, 16 May 2004 08:41:51 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Use ISNULL to set the value to the default value when NULL

2. PDOXWIN: Dynamic bind of form at startup shows no values

3. Setting up default values from the passed value

4. Add more than one value in a value list [checkbox]

5. Passing field values form one form to another!

6. Passing values form -> form

7. Using last entered value for default value in ISQL FORMS

8. Getting a value form a form

9. Need To Get Value From Form To Form

10. Forms 6.0 APIs : Setting Form Module Property Class

11. Using last entered value for default value in ISQL FORMS

12. Counting the Number of Check Values in Checkboxes


 
Powered by phpBB® Forum Software