Results 1 to 3 of 3

Thread: Validating a date [Resolved]

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Location
    Bristol, UK
    Posts
    10

    Resolved Validating a date [Resolved]

    What sort of thing would I need to put in the validate event of a textbox to make sure that only a date between two certain dates could be added? Thanks.
    Last edited by sg1psychopath; May 11th, 2005 at 12:15 PM.

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: Validating a date

    On the lost focus event..

    If trim(txtdate.text) <> "" then
    if isdate(txtdate.text) then
    if cdate(txtdate.text) >= cdate("01/01/2001") and cdate <= cdate("01/01/2001") then
    esle
    'send error message
    txtdate.setfocus
    endif
    endif

    change the dates to suit your needs

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Location
    Bristol, UK
    Posts
    10

    Re: Validating a date

    Thanks, just what I needed.

Posting Permissions

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



Click Here to Expand Forum to Full Width