yes/no combobox, null and bit or tinyint field

  • Thread starter Charles Calvert
  • Start date
C

Charles Calvert

I'm using SQL Server 2000 with Access 2000/2002/2003 (file is
formatted as 2000).

I have a field in a table in SQL Server that is linked to the Access
file. The field was originally a bit, but I have also tested with
tinyint. The field allows nulls and the default is null.

I would like to have a combobox containing the values "yes" and "no"
bound to the field. When the value is Null, I would like nothing to
be selected. When the value is 0 or 1, I would like "no" and "yes" to
be selected, respectively.

After googling the archives for over an hour, I have found posts
stating that Access doesn't play well with bit fields containing null,
so I switched to tinyint. That seems to avoid the complaints from
Access, but it is interpretting null as 0 and selecting "no".

Is there a way to do what I want?

Thanks,
 
A

Allen Browne

Tinyint should work fine.

How it the combo set up?
Try properties like this:
Row Source Type Value List
Row Source 1;"Yes";0;"No"
Bound Column 1
Columns Widths 0
 
C

Charles Calvert

Tinyint should work fine.

How it the combo set up?
Try properties like this:
Row Source Type Value List
Row Source 1;"Yes";0;"No"
Bound Column 1
Columns Widths 0

Thanks for the response. I ended up kludging something together to
slave an unbound combo to a bound textbox.

I think that I tried something like this, but I may have messed up one
of the properties. I'll try again and see what happens.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top