Text Box Date

uplink600

Registered User.
Local time
Today, 12:13
Joined
Mar 18, 2004
Messages
69
Hi

Is there a way I can get a text box to only accept a date if it falls on a particular day of the week. For example only if the date happens to be a Tuesday. Can anyone advise some VBA code to achieve this.

Thanks

VC
 
Please note the difference between the Visual Basic forum and the Modules & VBA forum. I've moved this thread into the the latter.

Code:
Private Sub MyTextBox_BeforeUpdate(Cancel As Integer)
    If WeekDay(Date) <> vbTuesday Then
        MsgBox "Can't enter in this box today.", vbExclamation
        Me.MyTextBox.Undo
        Cancel = True
    End If
End Sub
 
Thanks for your help and for moving the thread.

VC
 

Users who are viewing this thread

Back
Top Bottom