paddysheeran
05-22-2009, 07:12 AM
Hi All
i have the following code which should enter last months date into a message box for the user to confirm whether it is correct or not:
Sub DateInput()
Dim Request As String
Dim ReportTitle As String
Dim DefValue As Date
Dim ReportDate As Date
Request = "Please enter the Reporting Month"
ReportTitle = "Ros Monthly Customer Service Report"
DefValue = DateSerial(Year(Now()), Month(Now()) - 1, Day(Now()))
ReportDate = Format(CDate(InputBox(Request, ReportTitle, DefValue)), "mmm/yyyy")
End Sub
When I run the code the message box is populated with the full date but I just want it in a mmm/yyyy format. Can anyone show me where im going wrong?
i have the following code which should enter last months date into a message box for the user to confirm whether it is correct or not:
Sub DateInput()
Dim Request As String
Dim ReportTitle As String
Dim DefValue As Date
Dim ReportDate As Date
Request = "Please enter the Reporting Month"
ReportTitle = "Ros Monthly Customer Service Report"
DefValue = DateSerial(Year(Now()), Month(Now()) - 1, Day(Now()))
ReportDate = Format(CDate(InputBox(Request, ReportTitle, DefValue)), "mmm/yyyy")
End Sub
When I run the code the message box is populated with the full date but I just want it in a mmm/yyyy format. Can anyone show me where im going wrong?