Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 113
Default UserForm text box Date formatting

I have a UserForm textbox being used to capture a date. I
want to stop the user, on the UserForm, if the date is not
inputed correctly (01/01/04) or if a non-date is inputed.
Last night, I had a suggestion to use the IsDate function
but I am a newbie. Is the "Input Mask" feature, used in MS
Access, available in VBA? Can you give me suggestions on
how to use IsDate or a better solution?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default UserForm text box Date formatting

userform controls have no mask or validation capabilities inherent in their
properties or methods.

Private Sub Textbox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
sStr = Userform1.Textbox1.Text
if not isDate(sStr) then
Userform.Textbox1.Text = ""
msgbox "Bad date in Textbox1"
cancel = True
end if
End sub

--
Regards,
Tom Ogivy

"Dan" wrote in message
...
I have a UserForm textbox being used to capture a date. I
want to stop the user, on the UserForm, if the date is not
inputed correctly (01/01/04) or if a non-date is inputed.
Last night, I had a suggestion to use the IsDate function
but I am a newbie. Is the "Input Mask" feature, used in MS
Access, available in VBA? Can you give me suggestions on
how to use IsDate or a better solution?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 113
Default UserForm text box Date formatting

Thanks Tom, you have been big help. Dan
-----Original Message-----
userform controls have no mask or validation capabilities

inherent in their
properties or methods.

Private Sub Textbox1_Exit(ByVal Cancel As

MSForms.ReturnBoolean)
sStr = Userform1.Textbox1.Text
if not isDate(sStr) then
Userform.Textbox1.Text = ""
msgbox "Bad date in Textbox1"
cancel = True
end if
End sub

--
Regards,
Tom Ogivy

"Dan" wrote in

message
...
I have a UserForm textbox being used to capture a date.

I
want to stop the user, on the UserForm, if the date is

not
inputed correctly (01/01/04) or if a non-date is

inputed.
Last night, I had a suggestion to use the IsDate

function
but I am a newbie. Is the "Input Mask" feature, used in

MS
Access, available in VBA? Can you give me suggestions on
how to use IsDate or a better solution?

Thanks.



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date formatting from text morlo Excel Discussion (Misc queries) 5 October 22nd 07 03:54 PM
Text & Date Formatting Slashman Excel Worksheet Functions 4 October 5th 06 09:16 PM
Formatting text and date together Brisbane Rob Excel Discussion (Misc queries) 2 December 10th 05 10:00 AM
Date formatting a text box JENNA Excel Programming 3 February 11th 04 09:25 AM
formatting text in TextBox in UserForm Kevin Excel Programming 2 November 7th 03 01:34 PM


All times are GMT +1. The time now is 01:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"