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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

masking inputbox

Status
Not open for further replies.

jscorpion

Programmer
Nov 17, 2000
40
US
I would like to have a pop up inputbox that is masked for the proper date and time. I know there is a contol that uses maskedit but I would like it to be an iputbox. An example may be an inputbox saying.

Please enter today's date and time.

__/__/__ __:__

I can't seem to find the proper setup so I would greatly appreciate any help.

Thank You

jscorpion
 
I was curious of this issue myself and did a little research. What I found out is this, yes you can mask an input box BUT, it is quite advanced. Most posts I've seen recommend a new form that looks like an input box and then formatting the text box on that form.

HTH
Ken ::)
 
Thanks for your input, but I have thought of that. I can't do it like that because I am writing a program using activeX documents. The documents aren't as easy to switch back and fouth like forms are. Thanks for the input.

jscorpion
 
I did get some results going to Google. Try looking up...
"Input mask on inpubox in VB" That's what I entered and did get some results that may point you in the right direction.

HTH
binky ::)
 
Hey dudes I use this code to do just what you want to do. You will have to modify alittle since I don't ask for the time.

Private Sub cmdCHECK_Click()
If IsNull(Me.DateFrom.FormattedText) Or Me.DateFrom.FormattedText = " / / " Then
MsgBox "Please Enter the 'From' Date Range and try again.", vbOKOnly + vbExclamation
Screen.ActiveForm.Controls("DateFrom").SetFocus
Exit Sub
End If
If IsNull(Me.DateTo.FormattedText) Or Me.DateTo.FormattedText = " / / " Then
MsgBox "Please Enter the 'To' Date Range and try again.", vbOKOnly + vbExclamation
Screen.ActiveForm.Controls("DateTo").SetFocus
Exit Sub
End If
If CDate(Me.DateFrom) > CDate(Me.DateTo) Then
MsgBox "Please Enter a 'To' Date that is After the 'From' Date." & _
"Try again", vbExclamation + vbOKOnly, "Please Try Again!"
Screen.ActiveForm.Controls("DateTo").SetFocus
Exit Sub
End If

Hope I helped you

TheKing [pc3]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top