Professional Web Applications Themes

options for form entry validation - ASP Database

Creating an application website with MS Access on a Windows 2000 Server. I have a page where the user can enter in a "startdate" and "enddate"; these become parameters in a saved parameter query, and it works quite well (thanks especially to Bob B for his help with this issue). Since the date originates from a linked text flat file, and since the date is in text format using leading zeroes (01/01/04, for example), it only works when the user enters the date in this format. on the data entry page, i can of course mention to use the proper ...

  1. #1

    Default options for form entry validation

    Creating an application website with MS Access on a Windows 2000
    Server.

    I have a page where the user can enter in a "startdate" and "enddate";
    these become parameters in a saved parameter query, and it works quite
    well (thanks especially to Bob B for his help with this issue).

    Since the date originates from a linked text flat file, and since the
    date is in text format using leading zeroes (01/01/04, for example),
    it only works when the user enters the date in this format.

    on the data entry page, i can of course mention to use the proper
    format, but i'm wondering if I also can/should:

    1. just munge the data in the receiving page with some logic to "fix"
    the data if it is in the wrong format (using some sort of "replace"
    asp code logic)? , and/or:
    2. put in some clientside or server-side validation?
    3. create an expression in the access query that changes the text date
    to a numerical date that can accept any kind of date entry?

    if 2 above is the best answer to this, is there an easy way (I'm using
    ASP and not ASP.net) to have a custom error message to tell the user
    exactly what is wrong? like an alert that sez "Pls enter dates in
    following format...blah, blah"

    Thanks in advance for any ideas.

    Larry
    - - - - - - - - - - - - - - - - - -
    "Forget it, Jake. It's Chinatown."
    Larry Rekow Guest

  2. #2

    Default Re: options for form entry validation

    Larry Rekow wrote:
    > Creating an application website with MS Access on a Windows 2000
    > Server.
    >
    > I have a page where the user can enter in a "startdate" and "enddate";
    > these become parameters in a saved parameter query, and it works quite
    > well (thanks especially to Bob B for his help with this issue).
    You'e welcome.
    >
    > Since the date originates from a linked text flat file, and since the
    > date is in text format using leading zeroes (01/01/04, for example),
    > it only works when the user enters the date in this format.
    Could you clarify this statement? Are you directly querying the linked text
    file? or are you moving the data from the linked file into a native Jet
    table? If the latter, why aren't you storing the dates in a date/Time field
    so you don't have this date format issue? It seems to me that you would be
    better off using dates in an unambiguous format (ISO: yyyy/mm/dd) in your
    queries.
    >
    > on the data entry page, i can of course mention to use the proper
    > format, but i'm wondering if I also can/should:
    >
    > 1. just munge the data in the receiving page with some logic to "fix"
    > the data if it is in the wrong format (using some sort of "replace"
    > asp code logic)? , and/or:
    I would hesitate to do this if it is important that the user's intended date
    not be mistaken.
    > 2. put in some clientside or server-side validation?
    Both should probably be done.
    > 3. create an expression in the access query that changes the text date
    > to a numerical date that can accept any kind of date entry?
    >
    > if 2 above is the best answer to this, is there an easy way (I'm using
    > ASP and not ASP.net) to have a custom error message to tell the user
    > exactly what is wrong? like an alert that sez "Pls enter dates in
    > following format...blah, blah"
    >
    I very often use a javascript calendar to simplify date entry. Google should
    turn up dozens of them for you. I think Aaron mentions some at his aspfaq
    site.
    Alternatively, it's less user-friendly, but using three dropdowns for year
    month and day practically guarantees mistake-free dates, especially if you
    make them dependent to prevent the entry of 2004-02-30 for example.Even with
    this, I would include server-side validation.

    Bob Barrows

    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows [MVP] Guest

  3. #3

    Default Re: options for form entry validation

    On Sun, 8 Aug 2004 08:30:24 -0400, "Bob Barrows [MVP]"
    <reb01501NOyahoo.SPAMcom> wrote:
    >>
    >> Since the date originates from a linked text flat file, and since the
    >> date is in text format using leading zeroes (01/01/04, for example),
    >> it only works when the user enters the date in this format.
    >
    >Could you clarify this statement? Are you directly querying the linked text
    >file? or are you moving the data from the linked file into a native Jet
    >table? If the latter, why aren't you storing the dates in a date/Time field
    >so you don't have this date format issue? It seems to me that you would be
    >better off using dates in an unambiguous format (ISO: yyyy/mm/dd) in your
    >queries.
    ++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++
    A unix box runs a report which creates the text file once daily, and
    then it's automatically ftp'd to the windows box where it overwrites
    the previous text file. Since the file is a linked table, and not an
    imported table, the data is updated automatically in Access.

    I created a query in Access with the startdate and enddate parameters,
    but it would only work if the dates were input exactly like the
    original date field ENTRY-DATE; so I've added an expression:
    NUDATE: Format([ENTRY-DATE],"m/d/yy")

    then i put the criteria of [startdate] and [enddate] in that field
    instead of the ENTRY-DATE field, and now it works when users enter
    dates like: 1/1/04

    However, you've brought up other considerations, and I may indeed
    switch to the calender or drop-down ploy. I'm doing this application
    for use by customers of one of my clients, and need it to be as
    friendly and bullet-proof as possible, AND, I believe, they are in
    France which will certainly require an unambiguous date entry.

    Thanks again,

    Larry
    - - - - - - - - - - - - - - - - - -
    "Forget it, Jake. It's Chinatown."
    Larry Rekow Guest

  4. #4

    Default Re: options for form entry validation

    Larry Rekow wrote:
    > On Sun, 8 Aug 2004 08:30:24 -0400, "Bob Barrows [MVP]"
    > <reb01501NOyahoo.SPAMcom> wrote:
    >
    >>>
    >>> Since the date originates from a linked text flat file, and since
    >>> the date is in text format using leading zeroes (01/01/04, for
    >>> example),
    >>> it only works when the user enters the date in this format.
    >>
    >> Could you clarify this statement? Are you directly querying the
    >> linked text file? or are you moving the data from the linked file
    >> into a native Jet table? If the latter, why aren't you storing the
    >> dates in a date/Time field so you don't have this date format issue?
    >> It seems to me that you would be better off using dates in an
    >> unambiguous format (ISO: yyyy/mm/dd) in your queries.
    > ++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++
    > A unix box runs a report which creates the text file once daily, and
    > then it's automatically ftp'd to the windows box where it overwrites
    > the previous text file. Since the file is a linked table, and not an
    > imported table, the data is updated automatically in Access.
    So you aren't moving the data from the linked text file into a native Access
    table. OK.

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

Similar Threads

  1. data entry form for many-to-many
    By andy in forum Microsoft Access
    Replies: 2
    Last Post: September 1st, 08:22 AM
  2. CFFORM Validation trumping Custom Form Validation
    By Beals in forum Macromedia ColdFusion
    Replies: 17
    Last Post: July 19th, 06:40 PM
  3. Passing form entry to URL variable
    By benkayuk in forum Macromedia ColdFusion
    Replies: 1
    Last Post: April 7th, 07:28 PM
  4. Data entry form
    By Michael in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: December 17th, 08:49 PM
  5. Obligatory entry on form
    By Rick Brandt in forum Microsoft Access
    Replies: 7
    Last Post: August 4th, 09:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139