?
Solved

Date Validation in R5

Posted on 1999-10-28
4
Medium Priority
?
208 Views
Last Modified: 2013-12-18
We have a date field in a layout region and would like to restrict only date values to be entered and not any other characters. it allows any character to be typed in the field, but performs its own built-in validation and displays 'Unable interpret time/date value'. we want to trap that and display our message. we have tried input validation, field exiting event etc. If we set the initial value of the date field as "" when calling the dialogbox, the error message appears. if we set a date as the initial value, the initial date is taken as the value for that field, even though we type some characters into it.
How to validate this date field with our error message?
0
Comment
Question by:iswg
  • 2
4 Comments
 

Accepted Solution

by:
jiaenloo earned 60 total points
ID: 2167659
iswq,
Use the field's exiting and entering events
Put the below Lotus script code into that can go into the field's exiting event, the field need not be of type time:

       Dim ws As New notesuiworkspace
       Dim uid As notesuidocument
       Set uid = ws.currentdocument
       'ENTER YOUR DATE FIELD NAME HERE
       dtxt = uid.fieldgettext("date_field_name")
       If dtxt <> "" Then                
          If Not Isdate(dtxt) Then
       'ENTER THE MESSAGE YOU WANT TO DISPLAY HERE
          Messagebox "Please enter a valid date"
          Call uid.gotofield("date_field_name")
          Else
            Call uid.fieldsettext("date_field_name",Str(Cdat(dtxt)))
          End If
       End If
0
 

Author Comment

by:iswg
ID: 2167940
jiaenloo,

 we have tried the exiting script also. the field has to be a date field only because we are using the native OS style type (with the calender dates). does this code depend upon the initial value we are giving to this field? How to make this work when we give "" as the initial value to this field?
0
 

Expert Comment

by:jiaenloo
ID: 2173113
What about just leave the initial value blank, ie no need to put anything, not even "", just blank.
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 2181376
Cool ISWG !

I am back to Form !  :)

Use !@IsDate Function to check for the content and @Failure or @Return to give you proper error message !

This will suppress the notes internal message

:)
Arun
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
Suggested Courses

593 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question