Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Option button not showing change Expand / Collapse
Author
Message
Posted Monday, April 2, 2012 12:22 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, August 25, 2014 8:35 PM
Points: 187, Visits: 434
I have an option group on my access 2007 form with a data type of bit on a backend sql server. The default value is 0 and labeled as "Pending" on the form. The alternate option value is 1 and labeled as "Closed" on the form.
When I change the selection to "Closed" the buttons both show as empty. I have attached three images to demonstrate what is happening.

The database is on a sql server 2008 server and the access database is linked to the database.

Can anyone offer any suggestions as to why this might happen? Thanks.


  Post Attachments 
access3.jpg (6 views, 5.82 KB)
access4.jpg (6 views, 7.04 KB)
access5.jpg (8 views, 240.63 KB)
Post #1276837
Posted Monday, April 2, 2012 1:36 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Yesterday @ 4:38 PM
Points: 163, Visits: 600
Is the Option Group bound to the correct field (you have the button selected in your screen shot)? That's one possibility - another issue with Access and SQL bit fiels is that you must have the field set to nulls not allowed, and have a default value set. Otherwise you get unpredictable behavior.

Wendell
Colorful Colorado
You can't see the view if you don't climb the mountain!
Post #1276907
Posted Monday, April 2, 2012 2:08 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, August 25, 2014 8:35 PM
Points: 187, Visits: 434
Wendel,

you were correct on the column allowing nulls. I have changed this to

alter table CaseData Alter column CaseStatus BIT NOT NULL

In regards to setting a default value this is done in access when the new record is created.

I attached a result set from the sql server as an image.

The button's behavior hasn't change though. When I click on the "Closed" button it still disappears. I do notice however that the value in the sql server database changes to a 1 from a 0.

Could the issue be a setting on access such as visibility?


  Post Attachments 
access6.jpg (3 views, 60.67 KB)
Post #1276938
Posted Monday, April 2, 2012 2:35 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Yesterday @ 4:38 PM
Points: 163, Visits: 600
OK - that's a result of the difference in the way that SQL and Access represent True. In SQL it's a +1 - in Access it is a -1. Change the value for your button to a -1 and see if that solves the problem.

Wendell
Colorful Colorado
You can't see the view if you don't climb the mountain!
Post #1276952
Posted Monday, April 2, 2012 2:43 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, August 25, 2014 8:35 PM
Points: 187, Visits: 434
Bingo!!! You were right on the money. Thanks Wendel!!!!!!!
Post #1276957
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse