Ticking Check Boxes

azizrasul

Well-known Member
Joined
Jul 7, 2003
Messages
1,262
I have an MS Access database where I am trying to place a tick in a check box if the Yes\No value in a recordset value is True. Here's a snippet of the code: -

Code:
    With objExcelApp
            If rst!sessioncompleted = True Then
                .Range("H9").Select
                .ActiveSheet("Check Box 1").Value = True
            End If
    End With
I get the run time error 438 i.e. Object doesn't support this property or method on the .ActiveSheet line. Any ideas anyone?
 
Last edited:

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

smozgur

BatCoder
Joined
Feb 28, 2002
Messages
1,270
I have to assume that it is an Excel workbook you are trying to tick a checkmark on the active worksheet according to Access recordset field value from the Access module. Again, I have to assume that it is "check box form control", not Visual Basic Checkbox Control (I guess from the checkbox name). Please ignore the comment below if I am wrong.

It should be like following I guess:

.Activesheet.Shapes("Check Box 1").OLEFormat.Object.Value = True
 

azizrasul

Well-known Member
Joined
Jul 7, 2003
Messages
1,262
I'm writing the code from Access. I tried

If rst!sessioncompleted = True Then
.Range("H" & x).Select
.Range("H" & x).Value = True
End If

and it worked. I hadn't realised that I had linked the cell to the check boxes.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,499
Messages
5,596,515
Members
414,074
Latest member
Matthew Kakde

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top