Why Are The Check Boxes Greyed Out

TellM1955

New Member
Joined
Apr 8, 2021
Messages
25
Office Version
  1. 2016
Platform
  1. Windows
  2. Mobile
I've a problem Editing a record. For whatever reason the last 2 columns of checkboxes are greyed out and the incorrect data is being read back in. I've provided the code that writes the data back in

Can anyone advise what the problem is or suggest the necessary changes I need to make to correct?

Thanks

VBA Code:
Private Sub ReadStudentsDetails()
  
  Dim CurrentIDCell As Range
  
  Set CurrentIDCell = shStudents.Range("a1").Offset(CurrentRecordID, 0)
  
  txtSName.value = CurrentIDCell.Offset(0, 1).value
  txtFName.value = CurrentIDCell.Offset(0, 2).value
  CboYear.ListIndex = _
      WorksheetFunction.Match(CurrentIDCell.Offset(0, 3).value, _
      ShLists.Range("b2:b8"), 0) - 2
  ChkMHome.value = CurrentIDCell.Offset(0, 5).value
  ChkMClub.value = CurrentIDCell.Offset(0, 6).value
  chkMBus.value = CurrentIDCell.Offset(0, 7).value
  ChkMBoard.value = CurrentIDCell.Offset(0, 8).value
  ChkTHome.value = CurrentIDCell.Offset(0, 9).value
  ChkTClub.value = CurrentIDCell.Offset(0, 10).value
  ChkTBus.value = CurrentIDCell.Offset(0, 11).value
  ChkTBoard.value = CurrentIDCell.Offset(0, 12).value
  ChkWHome.value = CurrentIDCell.Offset(0, 13).value
  ChkWClub.value = CurrentIDCell.Offset(0, 14).value
  ChkWBus.value = CurrentIDCell.Offset(0, 15).value
  ChkWBoard.value = CurrentIDCell.Offset(0, 16).value
  ChkWHome.value = CurrentIDCell.Offset(0, 17).value
  ChkWClub.value = CurrentIDCell.Offset(0, 18).value
  ChkWBus.value = CurrentIDCell.Offset(0, 19).value
  ChkWBoard.value = CurrentIDCell.Offset(0, 20).value
  ChkWHome.value = CurrentIDCell.Offset(0, 21).value
  ChkWClub.value = CurrentIDCell.Offset(0, 22).value
  ChkWBus.value = CurrentIDCell.Offset(0, 23).value
  ChkWBoard.value = CurrentIDCell.Offset(0, 24).value
  ChkThHome.value = CurrentIDCell.Offset(0, 25).value
  ChkThclub.value = CurrentIDCell.Offset(0, 26).value
  ChkThBus.value = CurrentIDCell.Offset(0, 27).value
  ChkThBoard.value = CurrentIDCell.Offset(0, 28).value
  ChkFHome.value = CurrentIDCell.Offset(0, 29).value
  ChkFClub.value = CurrentIDCell.Offset(0, 30).value
  ChkFBus.value = CurrentIDCell.Offset(0, 31).value
  ChkFBoard.value = CurrentIDCell.Offset(0, 32).value
  ChkSHome.value = CurrentIDCell.Offset(0, 33).value
  ChkSClub.value = CurrentIDCell.Offset(0, 34).value
  ChkSBus.value = CurrentIDCell.Offset(0, 35).value
  ChkSBoard.value = CurrentIDCell.Offset(0, 36).value
  
  
End Sub
 

Attachments

  • VBA Form Greyed.png
    VBA Form Greyed.png
    14.6 KB · Views: 8

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
It looks like those checkboxes that are greyed out have been assigned Null values. This can happen when assigning a value from a blank cell. For additional information, have a look at the following article...


Hope this helps!
 
Upvote 0
Dom, thanks for the information om the triple state. However, I'm not so sure this is the issue. All the check boxes are all set to False and the data I'm trying to write into them are both true and false, yet on the form they are all greyed out as all being true.
Cheers
 
Upvote 0
They are either true and disabled or they are null, as Domenic said. Is their Triple State property set to True or False?
 
Upvote 0
Are they all enabled?
 
Upvote 0
Rory, yep they are all enabled. As I said, I could understand better if the data they were displaying was correct and them being greyed out. But, displaying the wrong data is confusing. I would send a sample file but it appears, it's possibly me, there isn't a means to do this.
 
Upvote 0
You have to upload to a sharing site like OneDrive and then post a link here
 
Upvote 0
The form itself seems fine so the only other option is that you are assigning the value of blank cells to the controls.
 
Upvote 1
Solution

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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
Back
Top