I have a userform with checkboxes for each meal that a user is eligible to receive reimbursement for based on time calculations on my database. All of that is working appropriately, however, I have posted to another forum requesting assistance to lock down a checkbox if it isn't populated with a checkmark so the user isn't able to select it because the meal isn't allowed. The other forum user and I have tried several things and nothing seems to be working. I have confidence in him and I have no doubt that he is more than capable to answer, and it doesn't seem that the solution should be difficult, but I am also still new at VBA coding, so I am assuming that I am not relaying the information correctly? Here is the link to the 'crosspost' so you can see what has been done already: https://stackoverflow.com/questions/59721077/userform-checkbox-questions I will gladly post the solution to my problem to that forum if someone here can assist me and if that is proper protocol.
Here is the current coding that isn't working properly:
Here is the current coding that isn't working properly:
Code:
Private Sub txtArrivalTime_AfterUpdate()'When time is entered, time transfers immediately to spreadsheet datafield and sends back to userform which meals are allowed.
Dim TargetRow As Integer
TargetRow = Sheets("Codes").Range("D43").Value + 1
With Sheets("Travel Expense Voucher").Range("Data_Start").Offset(TargetRow, 26)
.Value = TimeValue(txtArrivalTime)
.NumberFormat = "hh:mm" 'arrival time
End With
'''MEALS ALLOWED PER SPREADSHEET TO USERFORM'''
If Sheets("Travel Expense Voucher").Range("Data_Start").Offset(TargetRow, 28).Value = "T" Then
frmUserTravel.chkMorning = Checked
End If
If frmUserTravel.chkMorning = Unchecked Then
frmUserTravel.chkMorning.Enabled = False
End If
If Sheets("Travel Expense Voucher").Range("Data_Start").Offset(TargetRow, 30).Value = "T" Then
frmUserTravel.chkMidday = Checked
End If
If frmUserTravel.chkMidday = Unchecked Then
frmUserTravel.chkMidday.Enabled = False
End If
If Sheets("Travel Expense Voucher").Range("Data_Start").Offset(TargetRow, 32).Value = "T" Then
frmUserTravel.chkEvening = Checked
End If
If frmUserTravel.chkEvening = Unchecked Then
frmUserTravel.chkMidday.Enabled = False
End If
'''END MOVEMENT OF MEALS ALLOWED TO USERFORM'''
End Sub