Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Newbie: help with text field mask and validation

Discussion in 'Information Technology' started by Andrew L., Jul 28, 2006.

  1. Andrew L.

    Andrew L.
    Expand Collapse
    Guest

    I need to create a text (varchar (8)) field to hold dates. I want
    dates to be xx/xx/xxxx, with leading 0's for single digits. The reason
    for using a text field is that I want the user to be able to input
    "??" for unknown day/date/year. I could really use a hand in how to
    create the format/mask/validation for this.

    Thank You,
    Andrew L.
     
  2. Loading...

    Similar Threads Forum Date
    Newbie here, just wanted to introduce myself Interfaith Dialogues Jan 18, 2005
    Interfaith So Help Me O’ God, Yahweh, Allah, Vaheguru, Et. Al…… Interfaith Dialogues Oct 19, 2016
    Sikh News Mohali Firm Creates Portal To Help Kids Learn About Sikh And Punjabi Culture, Approaches Breaking News Sep 17, 2016
    Interracial And Interfaith Marriage, Help Needed To Confront/convince My Parents Love & Marriage Aug 16, 2016
    Khalsa Aid Sikh Charity Praised For Helping Stranded UK Travellers Sikh Organisations Jul 26, 2016

  3. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    Why not Use Null for unknown dates (which null is for?)
    Or if you really *must* distinguish between not filled in & unknown, add a
    Boolean Field to the table & Check box to the input form?
    You can then easily substitute the date for '??' in a report, if so desired
    (and on the form for that mather)

    Pieter

    "Andrew L." <user@user.net> wrote in message
    news:btbgc2phgm6sopp3fmdgh65f9rbj3bupj1@4ax.com...
    >I need to create a text (varchar (8)) field to hold dates. I want
    > dates to be xx/xx/xxxx, with leading 0's for single digits. The reason
    > for using a text field is that I want the user to be able to input
    > "??" for unknown day/date/year. I could really use a hand in how to
    > create the format/mask/validation for this.
    >
    > Thank You,
    > Andrew L.
     
  4. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    Why not Use Null for unknown dates (which null is for?)
    Or if you really *must* distinguish between not filled in & unknown, add a
    Boolean Field to the table & Check box to the input form?
    You can then easily substitute the date for '??' in a report, if so desired
    (and on the form for that mather)

    Pieter

    "Andrew L." <user@user.net> wrote in message
    news:btbgc2phgm6sopp3fmdgh65f9rbj3bupj1@4ax.com...
    >I need to create a text (varchar (8)) field to hold dates. I want
    > dates to be xx/xx/xxxx, with leading 0's for single digits. The reason
    > for using a text field is that I want the user to be able to input
    > "??" for unknown day/date/year. I could really use a hand in how to
    > create the format/mask/validation for this.
    >
    > Thank You,
    > Andrew L.




    --
    ----------------------------------------
    I am using the free version of SPAMfighter for private users.
    It has removed 4367 spam emails to date.
    Paying users do not have this message in their emails.
    Get the free SPAMfighter here: http://www.spamfighter.com/len
     
  5. Andrew L.

    Andrew L.
    Expand Collapse
    Guest

    Unknown dates could be ??/??/yyyy, mm/??/yyyy, or ??/??/??.
    The dates need to be filled, it's a required field. Part of the
    reasoning is that the records must be sorted by date. There is a year
    (int (4)) field also, to help with this sort. I can create the table
    and import data correctly, with the sort working, but I am lost when
    it comes to creating the format/mask/validation for the date field.

    Andrew L.

    On Thu, 27 Jul 2006 10:45:52 +0200, "Pieter Wijnen"
    <it.isi.llegal.to.send.unsollicited.mail.wijnen.nospam.please@online.replace.with.norway>
    wrote:

    >Why not Use Null for unknown dates (which null is for?)
    >Or if you really *must* distinguish between not filled in & unknown, add a
    >Boolean Field to the table & Check box to the input form?
    >You can then easily substitute the date for '??' in a report, if so desired
    >(and on the form for that mather)
    >
    >Pieter
    >
    >"Andrew L." <user@user.net> wrote in message
    >news:btbgc2phgm6sopp3fmdgh65f9rbj3bupj1@4ax.com...
    >>I need to create a text (varchar (8)) field to hold dates. I want
    >> dates to be xx/xx/xxxx, with leading 0's for single digits. The reason
    >> for using a text field is that I want the user to be able to input
    >> "??" for unknown day/date/year. I could really use a hand in how to
    >> create the format/mask/validation for this.
    >>
    >> Thank You,
    >> Andrew L.
     
  6. John Nurick

    John Nurick
    Expand Collapse
    Guest

    For a validation rule, try this
    Like "[?0-9][?0-9][?0-9][?0-9][?0-9][?0-9][?0-9][?0-9]"
    to require eight characters each of which can be a digit or a ?. Insert /
    characters in the expression as required.

    For more subtle validation, in the BeforeUpdate event of a form or control,
    there's the rgxValidate() function at
    http://www.mvps.org/access/modules/mdl0063.htm. With a pattern like this

    [?0-3][?0-9]/[?01][?0-9]/(?:[?12][?0-9])?[?0-9]{2}

    it will accept two digits or question marks for day and month, and two or
    four digits and question marks for the year. If you want to reject
    impossible dates, such as the 39th of August or 29th February 2005, things
    get rather more complicated.

    "Andrew L." <user@user.net> wrote in message
    news:btbgc2phgm6sopp3fmdgh65f9rbj3bupj1@4ax.com...
    >I need to create a text (varchar (8)) field to hold dates. I want
    > dates to be xx/xx/xxxx, with leading 0's for single digits. The reason
    > for using a text field is that I want the user to be able to input
    > "??" for unknown day/date/year. I could really use a hand in how to
    > create the format/mask/validation for this.
    >
    > Thank You,
    > Andrew L.
     

Share This Page