place a checkbox on subform and use a field in linked sql server table

Access 2010
sql server 2008
Access form and subform

I need to place a checkbox on a subform and use a linked sql server table  and control source the checkbox to the field in sql server ?

What field (datatype) do i use on the sql server side ?
and any others issues that nay arise, what might they be ?

Thanks
fordraiders
LVL 3
FordraidersAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PatHartmanCommented:
I would use SmallInt.  Access supports three states for Yes/No data types - Null, true, false but SQL server only allows two for bit data types which is the obvious conversion path.  If your Y/N fields always have a default and are never null, then bit will be fine.  If they don't have a default and there may be some existing null values, you have to go with SmallInt.
0
FordraidersAuthor Commented:
The default will always be unchecked,."NO"
0
Anthony PerkinsCommented:
SQL server only allows two for bit data types which is the obvious conversion path.  
You may want to double check that.  A bit data type allows 1, 0 or NULL.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

PatHartmanCommented:
Looks like you are correct.  I wonder if that is a change in newer versions of SQL Server or if the problem was in fact caused by the upsizing wizard marking these fields as required.  I guess I'll never know.  Today Bit works fine.
0
FordraidersAuthor Commented:
ok, I added a field to the sql server table  "smallint"

I have a checkbox in my subform now, but the checkbox will not let me check or uncheck.

The the values in the field are 0(uncheck) and 1(check)
But the checkbox stays a blue color ?

Thanks
fordraiders
0
PatHartmanCommented:
Is it bound? Did you just add the checkbox or did you mess with its properties?  Is the form updateable?  Is the underlying query updateable?
0
FordraidersAuthor Commented:
IT IS BOUND....just the default value  = 1
0
PatHartmanCommented:
I count 4 questions and I see 1 answer.
0
FordraidersAuthor Commented:
Is it bound?   YES
Did you just add the checkbox ?  yes, ADDED IT
or did you mess with its properties?  just the default value  = 1
Is the form updateable? YES
Is the underlying query updateable? YES
ALLOW EDITS  =  YES on both forms
0
PatHartmanCommented:
Is the control enabled and unlocked?
0
FordraidersAuthor Commented:
enabled =  yes
locked  =  no
0
FordraidersAuthor Commented:
at the bottom of the screen, The error message, The Control cant be edited, its bound to an unknown field  "SKU_THRESHOLD"
WHICH IS THE CORRECT NAME...
0
PatHartmanCommented:
Access disagrees.  This is a battle you can't win.  You'll have to find the typo.
0
FordraidersAuthor Commented:
Pat, Lets go a different route.
If i keep it unbound.
I have 5 lines in the subform.
and make a check in the first box. NOW
"all the boxes" are marked with a check ?
If i take the check out, All the lines are taken out.



dp
0
FordraidersAuthor Commented:
pat, ok...I added the actual field the checkbox is bound to on the subform.
Now it will let me at least check the checkbox.
and
it adds the value to the field.  "TRUE" or "FALSE"

however, now it wont let me check more than One Checkbox.. ?
0
FordraidersAuthor Commented:
nm, Just aint workin.
0
PatHartmanCommented:
I'm glad you moved away from the unbound route.  It is possible on a single form but on a continuous form, you get everything set to the value from the current record as you saw.  That is because multi-record forms are simply multiple instances of a single record form.  when there is bound data, that works fine but since there is only one set of properties, all visible instances show the same value because there is only one value.
ok...I added the actual field the checkbox is bound to on the subform.
Hadn't you done that before?
however, now it wont let me check more than One Checkbox.. ?
I can't picture what you are doing.  Are you talking about multiple checkboxes on one record or the same field on different rows?
0
FordraidersAuthor Commented:
subform checkbox
Pat trying this..this is the subform
0
PatHartmanCommented:
1. There is a problem with the Send field.  Is it bound?  Is the bound field used any where else on the form?
2. Check32 really should have a proper name.
0
FordraidersAuthor Commented:
Pat, Here is what i had to do.   I changed the combox to a Yes,No choice.
But bound the choices to a seperate table.
I then stored the value chosen (from the combobox)in the sql server field..
it is storing it as   "1" or "2" in the field.
0
PatHartmanCommented:
The combo itself is bound to the RecordSource of the form or report.  The RowSource of the Combo (this is what produces the list of choices), can be bound to a table or query different from the form's RecordSource and usually is.  Sometimes for short, unchanging lists, you might use a ValueList instead of a table or query.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FordraidersAuthor Commented:
Thanks very much !
0
PatHartmanCommented:
You're welcome.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.