Input Mask

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

Is there anyway to get Access to read this type of format in the input mask?

"20050919"

I'm wanting to enter the date in this format....20050919...I was told Access
can not recognize this type of date format...just wanted to double check!

Thx all!

t
 
Here is the Input Mask you need: 0000\/00\/00
You will still have to validate the input to ensure it is a good date. Here
is the code for that:

Private Sub Text9_BeforeUpdate(Cancel As Integer)
Dim strChkDate As String
strChkDate = Left(Me.Text9, 4) & "/" & Mid(Me.Text9, 5, 2) & "/" &
Right(Me.Text9, 2)
If Not IsDate(strChkDate) Then
MsgBox strChkDate & " Is Not A Valid Date", vbExclamation +
vbOKOnly, "Date Error"
Cancel = True
End If
End Sub
 
Klatuu,

Do I have to use the code Klatuu? Or is it for making sure the date is good?

Thank you so much for your help, I'm trying this now and may be a little bit
before I get back, like this afternoon or in the morning...thank you so
much...I didn't think it could be done!

Klatuu, where are you from?

I'll be talking at you soon!

tim
 
Klatuu,

It is giving me the slashes ...2005/09/25 and converting to another format
when I tab... it converts to 9/25/2005.

I suppose we can't get rid of the slashes and get it to stay in the same
format?

Thank you Klatuu for you help...your pretty smart :)~
 
Tim,

The code is to validate that the date is a valid date. The IsDate()
function will not recognize a series of numbers as a date without the
slashes. I don't know why it is reformatting on you. I did not have that
problem. I am using 2003.

And, Thanks, but I am not that smart, just been doing this sort of thing for
28 years.
 
Back
Top