Hi Forum,
I'm trying to assign a caption to a label based off the value (or lack there of) in a corresponding textbox. The value in the textbox can be blank, a date, or the word "not completed". I'm struggling to find the code to recognize the value in the textbox as a date and check if that date is greater or less than/equal to today's date. Below is the current code I've been trying to use:
Where WCCnb is a temp variable, txtWCCnb is the textbox that holds the value, lblWCCnb.Caption is the label that I'm trying to change based off the value in txtWCCnb.![]()
Dim WCCnb As String WCCnb = txtWCCnb If WCCnb > Date Then lblWCCnb.Caption = "Scheduled for " & WCCnb If WCCnb <= Date Then lblWCCnb.Caption = "Completed on " & WCCnb Else: lblWCCnb.Caption = "Not Completed" End If
Please let me know if you have any suggestions!
Bookmarks