Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export value of a checkbox from Excel to Access 1

Status
Not open for further replies.

jpkeller55

Technical User
Apr 11, 2003
131
US
I am using expressions below to capture values of certain data in cells of an excel spreadsheet and exporting to an Access database. What is the syntax for capturing the value of a checkbox? (e.g. checkBox1 = 1 if checked or 0 if not checked)
Code:
.Fields("Date") = Range("b" & 3).Value
.Fields("Time") = Range("b" & 4).Value
.Fields("Location") = Range("b" & 6).Value
.Fields("Desktop") = Range("b" & 8).Value
.Fields("Laptop") = Range("b" & 9).Value
 
It depends on the type of checkbox

Sheets("sheet1").Shapes("CheckBox1").Value = True
Sheets("sheet1").CheckBox1.Value = True

change the name of the checkbox

ck1999
 
I am putting in this expression and it is not populating to my Access table (2003)
Code:
.Fields("Test") = Sheets('Sheet1").CheckBox1.Value
Looks like I am missing something.
 
.Fields("Test") = Sheets("Sheet1").CheckBox1.Value

Sorry, had a typo in the previous post. Still have same problem...doesn't populate to the Access table
 



Code:
.Fields("Test") = Sheets([b][red]"[/red][/b]Sheet1").CheckBox1.Value


Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
This is working for me now. I think the reason it was not working for me before is because I had an error in my error statement that was preventing the script from running completely. Forgot to add a Resume statement. Working well...thanks for your help Skip and ck. JK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top