Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 25th, 2013, 02:33 PM
jprotivnak jprotivnak is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 2 jprotivnak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 11 m 45 sec
Reputation Power: 0
Access support for checkbox against linked table

I have an Access file that is using a linked Oracle table.
When I open the linked table in Access, I want to have a column display as a checkbox like the YES/NO Access datatype does.
Does anyone know how I can accomplish this? Any help would be greatly appreciated.

Reply With Quote
  #2  
Old January 28th, 2013, 05:59 PM
June7's Avatar
June7 June7 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2010
Location: The Great Land
Posts: 256 June7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 9 h 29 m 29 sec
Reputation Power: 5
__________________
I like to know if my suggestion helped you. One way to let me know is by clicking scales at top right corner of post.
Debug!Debug!Debug!http://www.cpearson.com/excel/debug.htm

Reply With Quote
  #3  
Old January 30th, 2013, 08:48 AM
jprotivnak jprotivnak is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 2 jprotivnak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 11 m 45 sec
Reputation Power: 0
Smile Solution

You can modify the linked table's TableDef. Add a DisplayControl property to your field with property value as 106 for a check box.

You can execute the code through the Immediate window.
(If you are not not familiar with the Immediate window. Open it with Ctrl+g. Enter a line of code press Enter, and so on for each line.)

Since Oracle has no SQL boolean type the field in Oracle should be something like a number(1,0) or varchar2(2)
*Note* Access saves "No" or unchecked as 0 and "Yes" or checked as -1.

Code:
set db = currentdb
set fld = db.TableDefs("dbo_foo").Fields("a_number")
fld.Properties.Append fld.CreateProperty("DisplayControl", dbInteger, 106)

"dbo_foo" being the linked table and "a_number" the field you want to checkboxify.

If for some reason your target field already has a DisplayControl value set already, just change the last line to only set the value:
Code:
fld.Properties("DisplayControl") = 106


' verify property created with correct value ...
Code:
? fld.Properties("DisplayControl")


After setting the property, my a_number field is displayed as a check box when "dbo_foo" is opened in Datasheet View.

Additionally, you can set other properties the same way instead of "DisplayControl" you could use:
"RowSourceType"
"RowSource"
"BoundColumn"
and so on...

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Access support for checkbox against linked table


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap