Attaching a checkbox to an SQL Server 2000 field (bit or binary)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. I've searched the kb and the groups, and I haven't found an answer to
this question. I apologize if I've overlooked it.

I have a table in SQL Server 2000, and a bound form in Access 2000. I
simply want to add a field in the table, and a bound checkbox on the form.
Can someone instruct me on this?

Thanks,
Rick
 
Adding the field in SQL is either done using Enterprise Manager, finding the
db, finding the table and doing a right click choose Design, or you do it
with QueryAnalyser and Alter Table.

When it's added, reattach the table to the MDB. Your queries / reports /
forms then have access to the value, allowing you to bind to it.
 
Thanks for the quick response, John. I don't have any trouble adding the
column to the table. I think I need guidance on choosing a data type. I've
tried both bit and binary. After adding the column, I readd the table to the
MDB. Then I add a checkbox to my form and bind it to the field. When I
test the checkbox, I either get an error or I can't get the checkbox to
behave correctly.

I was hoping for a recipe, rather than troubleshooting my own situation, but
I'll be happy to tell you how I got here.

Security is not an issue. I have dbo rights.

Okay, specifically: the SQL Server table has a column called appEDI, which
is Binary (50) and allows NULLs.

In Access, when I drag the field from the field list onto the form, a
textbox is created. I want a check box. I can't use Format, Change To to
change the tbx to a checkbox, as that option is grayed out. So I delete the
textbox, and add a CheckBox from the toolbox. I access Properties, and
choose appEDI as the control's ControlSource.

I Save and change to Form View. I see a record where appEDI is NULL. The
checkbox is gray. Clicking on the checkbox has no visible effect; i.e., it
stays gray. I open the table and find that non-printable characters have
been added to the appEDI field of the affected record. I delete these
characters, and type True. I reopen the form to this record, and I see the
checkbox has check in it. I click on it, and the box goes gray. I check the
record in the table and find non-printable characters. (Two of them; I
clicked more than once.)

It seems that I can't get SQLServer and Access to agree on the data type of
this field's content.
 
Back
Top