PC Review


Reply
Thread Tools Rate Thread

Check Input, into Input box question

 
 
Les Stout
Guest
Posts: n/a
 
      21st Jun 2007
Hello all, i have an input box(code below) and i have 3 entries, is
there a way that i can check that each entry made in the input box is in
actual fact in the date format 26/07/07 ??

Private Sub Workbook_Open()
'
Dim strDates As String, s As Variant

strDates = Application.InputBox("Enter the ""from"" ""to"" dates and
the" & vbCrLf & _
"date paid, each date seperated by a
"",""..", "SALARY PERIOD")
If strDates = False Then
End
Else
s = Split(strDates, ",")
Range("B11").Value = s(0)
Range("D11").Value = s(1)
Range("B21").Value = s(2)
PrintSlip
End If

End Sub


Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
merjet
Guest
Posts: n/a
 
      21st Jun 2007
A partial solution is to declare a date variable and test the input
values with it, e.g.
Dim dt1 as Date
dt1 = s(0)

If the input value isn't a date, a type mismatch will result.

Hth,
Merjet


 
Reply With Quote
 
Les Stout
Guest
Posts: n/a
 
      21st Jun 2007
Thanks merjet, will try... :0)

Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Input mask for text box to enforce numeric input and right adjust. karl dewey Microsoft Access Form Coding 0 27th Feb 2009 11:58 PM
Input mask date syntax-limit input to a number range =?Utf-8?B?QmlsbGlhbQ==?= Microsoft Access Database Table Design 2 18th Nov 2007 03:37 PM
input check in cell question Pierre via OfficeKB.com Microsoft Excel Programming 0 7th Nov 2005 07:19 AM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Microsoft Excel Programming 4 8th Dec 2003 03:22 PM
Newbie Question: Limit Input Value baseon previouse input =?Utf-8?B?R3JlZW5Cb3k=?= Microsoft Access 5 8th Nov 2003 12:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:34 AM.