If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > CheckBox in VB Updates CheckBox in Access Database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-05-11, 22:14
sparmour sparmour is offline
Registered User
 
Join Date: Oct 2011
Posts: 3
Question CheckBox in VB Updates CheckBox in Access Database

VB2010: Form with checkbox
Access2010: Table with Checkbox

I have created a form in VB that has a checkbox that I would like to use to update a field in a Access table. I've connected the database and have all the datasets and such but I am not sure what the code is to udpate the database for a checkbox. I've got all the textboxes updating the database I used the bindingnavigator for these but not sure what to use for the checkbox.

Private Sub OccupiedCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OccupiedCheckBox.CheckedChanged

End Sub

Any direction on this matter would be most appreciated.
Reply With Quote
  #2 (permalink)  
Old 10-06-11, 02:33
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
So this is a question about Visual Basic, not about Access?
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 10-06-11, 10:21
sparmour sparmour is offline
Registered User
 
Join Date: Oct 2011
Posts: 3
Yes, I would like to be able to code the checkbox on the VB form to update the Access database checkbox.
Reply With Quote
  #4 (permalink)  
Old 10-06-11, 10:30
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
no such thing as an Access database, Access is a RAD tool that talks to virtually any database out there, ranging from its own default format (confusingly called JET) to server products such as DB2, Oracle, SQL Server and so on. Im guessing you mean you are suign a JET database.

JET doesn't support a 'checkbox' directly, but does use the boolean datatype which can be mapped to a checkbox or other display mechanism.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #5 (permalink)  
Old 10-06-11, 10:41
sparmour sparmour is offline
Registered User
 
Join Date: Oct 2011
Posts: 3
Question

Ok, so how do I map this checkbox the the database created in Microsoft Access?
Reply With Quote
  #6 (permalink)  
Old 10-07-11, 04:26
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
the check box control has a value, which is going to be effectively a boolean value
its checked or not checked
so assign the value of the control to the relevant column in the database and do an update as you would with other controls mapped to specific column.

to set the control set the value of the controls relkevant property to the value fo the boolean column.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On