M
mk62
Where does the following subroutine go to make it run? In a module, query?
It would help if I included the sub:
Sub CheckDate()
Dim strDate As String
strDate = InputBox("Enter string to display as a date.")
' Test variable.
If IsDate(strDate) Then
' If string is date, format and display in dialog.
MsgBox "The date is: " & Format(DateValue(strDate), "Long Date")
Else
MsgBox "The value you entered is not a date."
End If
End Sub
I would like it to only return text that would fit into a specific format.John Vinson said:I would suggest that you copy and paste this code into a new Module.
Save the module with some name *DIFFERENT* than CheckDate - a module
and a sub cannot have the same name.
As written the code isn't going to be terribly useful - you could call
it from a Query but all it would do is pop up a message box no matter
what the user types. Could you explain what you *want* it to do?
John W. Vinson[MVP]
I would like it to only return text that would fit into a specific format.
(ie. short date, long Date, etc.)
mk62 said:Where does the following subroutine go to make it run? In a module, query?