Get Day from Date to Validate

D

David

I am trying to ensure that the user enters the first day of the month when
prompted, so I need to test the day from the date entered. The month and year
do not matter. Thanks!
Here is what I have, but it does not work:

myDate = InputBox(Prompt:="Enter the FIRST DAY of the Month you want to
Create", _
Default:=Format(Date, "mm/dd/yy"))

DayDate = myDate(Day) '(THIS IS WHERE THE PROBLEM IS)
If DayDate <> 1 Then
Msg = " You Did Not Enter The First Day of The Month" & Chr(10) & _
" Are You SURE You Want To Continue?"
Ans = MsgBox(Msg, vbYesNo)
If Ans = vbNo Then Exit Sub
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top