LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Prevent user moving to next control


hello, I have a box used exclusivley for date entry. If someone does not
enter it in this format "DD/MM/YYYY" then a msgbox appears saying "Date
must be entered in this format...". When this incorrect entry occurs I
would like to force the user to stay in the date box until he has
entered correctly. I have tried date1.setfocus, date1.tabstop and
everything else I can think of but nothing is working.

This is my code at the minute

Public Sub Date1_AfterUpdate()
If Date1.Value = Format(Date1.Value, "DD/MM/YYYY") Then
Else
MsgBox "Date must be entered in this format: DD/MM/YYYY"
End If

End Sub

Please help!!!

Thank You


--
johncassell
------------------------------------------------------------------------
johncassell's Profile: http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=391628

 
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
How to prevent data from moving to a different cell 40078046 Excel Worksheet Functions 1 February 28th 10 08:27 PM
how do i prevent a row from moving, like subheader that is visibl Binmaru New Users to Excel 3 January 16th 08 04:43 PM
Can I prevent a sheet from moving within a workbook? JDGUILTY Excel Programming 1 March 1st 05 05:53 PM
Can I prevent a sheet from moving within a workbook? JDGUILTY Excel Programming 4 March 1st 05 05:22 PM
Prevent control & break N10 Excel Programming 2 September 29th 04 10:32 AM


All times are GMT +1. The time now is 10:29 PM.

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

About Us

"It's about Microsoft Excel"