Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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...


  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.
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page