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
Rory, After a great deal of time searching, I've found the fault!! As usual its a human error. I'm only using 29 coulumns but was entering data into 34 columns as I'd duplicated my lines of code when copying and pasting. Apologies for wasting your time. Cheers.
 
Upvote 0

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

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