N
Nick T
Hi,
I have a text box (called S1). I also have a cmd button for which i need
help in working out the vb code for.
A date gets entered into text box 'S1' (dd/mm/yyyy). Then, when i click my
cmd button, if the date in 'S1' is todays date, then i want the backcolour to
go vb red.
This is my current code:
Private Sub Command51_Click()
If Me.S1 >= Now Then
Me.S1.BackColor = vbRed
End If
End Sub
Obvousley, the 'now' doesnt work, but what would??
Ie. if yesterdays date (or any other date) is in S1, i dont want the back
colour to change.
Any suggestions on the code for this??
Any help greatly appreciated.
Many thanks
I have a text box (called S1). I also have a cmd button for which i need
help in working out the vb code for.
A date gets entered into text box 'S1' (dd/mm/yyyy). Then, when i click my
cmd button, if the date in 'S1' is todays date, then i want the backcolour to
go vb red.
This is my current code:
Private Sub Command51_Click()
If Me.S1 >= Now Then
Me.S1.BackColor = vbRed
End If
End Sub
Obvousley, the 'now' doesnt work, but what would??
Ie. if yesterdays date (or any other date) is in S1, i dont want the back
colour to change.
Any suggestions on the code for this??
Any help greatly appreciated.
Many thanks