|
-
January 20th, 2000, 04:56 AM
#1
Date Validation
Hi ,
How do i check to see if the date entered in the textbox is in the correct format that i want it ot be.
Eg: If i want the date to be in dd/mm/yyyy format then what do i have to do to check that this is the format that is correct.
Can i write this in my code:--
If IsDate(txtStartDT.Text) Then
If txtStartDT.Text = mm / dd / yy Or txtStartDT.Text = yy / mm / dd Then
MsgBox "Please enter dd/mm/yyyy format for STARTDATE only."
txtStartDT.SetFocus
Exit Sub
End If
End If
I am working on a visual basic project and would like to know how to do this. i have an access database.
This is not html vbscript!
Also how do i stop someone from updating a certain textbox.
Like if i dont want a user to update the textbox having the employee's name. What will be the form validation!!!!!
Thanks for any answers,
New to Visual Basic ............
-
January 20th, 2000, 07:13 AM
#2
Re: Date Validation
>Also how do i stop someone from updating a certain textbox.
set the Locked property to True to protect the field from data entry.
Your date format problem:
when outputting date values I'd use the Format statement.
When interpreting date values assume that date values are in the format given in control panel - language settings.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|