I'm in a bit of a mess...
Okay, I have some VBA code that causes a label on my main form to change depending on the value that is in the check box in the record.
The idea:
The idea of part of my form is for the user to have to check a tick box to know that the 'thing' can be released. It's to make the user more aware. All 'things' are asumed to be in the category of 'Can't be released' until notified and the user checks the box in the form and thus the VBA should change the content of the label.
Existing Code:
The default value of the check box when a new record is created is no tick in the box, and default caption of the 'lblrelease' is "Can't be released", with the same red that is indicted in the code above.
The Problem:
The code to cause the label to change color/text does work to a degree. For example - if the check box is ticked then the text and color in the label will change to, and if there's no check in the check box then different color and text appears.
However, what I have noticed is that the label change doesn't stay bound to that record when browsing through the records on the form or creating a new record the colours from the previous record stays with the label into the next new record or new browsed record (the checkboxes themselves stay bound to the form/record and work fine - no problem with that) it just seems the content of the labels isn't working properly as I intented and would like the changes in the label caused by the text box to stay bound to that record.
I hope you guys understand. If not I can upload the database that can show you guys the problem.
Thanks for any help you may give.
Okay, I have some VBA code that causes a label on my main form to change depending on the value that is in the check box in the record.
The idea:
The idea of part of my form is for the user to have to check a tick box to know that the 'thing' can be released. It's to make the user more aware. All 'things' are asumed to be in the category of 'Can't be released' until notified and the user checks the box in the form and thus the VBA should change the content of the label.
Existing Code:
Code:
Private Sub tickrelease_AfterUpdate()
If Me.tickrelease = True Then
Me.lblrelease.ForeColor = vbGreen
Me.lblrelease.Caption = "Can be released"
Else
Me.lblrelease.ForeColor = vbRed
Me.lblrelease.Caption = "Can't be released"
End If
End Sub
The default value of the check box when a new record is created is no tick in the box, and default caption of the 'lblrelease' is "Can't be released", with the same red that is indicted in the code above.
The Problem:
The code to cause the label to change color/text does work to a degree. For example - if the check box is ticked then the text and color in the label will change to, and if there's no check in the check box then different color and text appears.
However, what I have noticed is that the label change doesn't stay bound to that record when browsing through the records on the form or creating a new record the colours from the previous record stays with the label into the next new record or new browsed record (the checkboxes themselves stay bound to the form/record and work fine - no problem with that) it just seems the content of the labels isn't working properly as I intented and would like the changes in the label caused by the text box to stay bound to that record.
I hope you guys understand. If not I can upload the database that can show you guys the problem.
Thanks for any help you may give.