Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InputBox - Validating

Status
Not open for further replies.

darinmc

Technical User
Feb 27, 2005
171
GB
Hi

I have an InputBox and am trying to validate it...
How do I force the user to ONLY type in numbers

I.E. like an input mask?
##/##/##

InpValue = InputBox(InpMsg, InpTitle)


Code:
Dim InpTitle, InpMsg, InpDefault, InpDt
Dim InpValue As Date

InpMsg = "PLEASE ENTER INVOICE DATE - E.g. 23/05/07"
InpTitle = "Invoice Creation"
'InpDefault = Me.txtWeDt

InpValue = InputBox(InpMsg, InpTitle)

Me.tInvDt = Format(InpValue, "dd/mm/yyyy")
'If user presses cancel then Me.tInvDt = ""

If Me.tInvDt = Null Or Me.tInvDt = "" Then
MsgBox "null - some message"
Else
MsgBox "SOME ACTION"
End If

Sorry if this seems very simple lol


Thx
Darin
 
The fastest/better way is to create your own form looks like inputbox.

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top