Ticking Check Boxes

azizrasul

Well-known Member
Joined
Jul 7, 2003
Messages
1,293
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
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:

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

smozgur

BatCoder
Joined
Feb 28, 2002
Messages
1,697
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,293
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,277
Messages
5,836,358
Members
430,423
Latest member
lord_traust

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