Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date format (97)

    Hi,

    I have some date fields in my database, which i understand can only accept certain formats, those namely of dates.
    Problem is upon entering my data there are some records where i need to put a 'n/a' in this field, which i cant do.
    If i set the type of field to text then i lose the date formatting and calculation methods, which i cant afford to do.

    does anyone have a way of overcoming these kind of problems? A lot of my records are displayed in datasheet view, so having another (conditional) field made visible / invisible might not work, but i thought about that as a possibilty.

    <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>
    Thanks,

    pmatz

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date format (97)

    Keep the field type as Date/Time, it takes a lot of work out of your hands. I take it that you can't use a blank date to signify N/A. You might add a Yes/No field that specifies whether a date is available.

    I almost never use forms in datasheet view. If I need a datasheet-like view, I create a continuous form that looks like a datasheet. A continuous form gives you (the designer) much more control than a datasheet form.

  3. #3
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date format (97)

    Ok, so if i had the form in a continous form view then I guess i coudl get around this much better.

    If the date is clear then it is awaiting update, but for those dates where it is 'n/a' i have put in 01/01/03 (as this is a day no one would have used as we are not at work).
    I could then run code to conditionally make a field with this date invisible, and have a textbox behind it with 'N/A' in it to show through? What do you think?

    thanks
    Thanks,

    pmatz

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date format (97)

    I don't think that will work. If you make a text box in a continuous form invisible, you make it invisible in all records, for there is really only one set of controls in a continuous form. Moreover, you wouldn't have a way to change the date back to a valid date. I would leave the date text box as it is, and put another control next to it to display the status of the date. For example, a text box with Control Source

    =IIf([DateField]=#01/01/03#,"N/A",Null)

    If you need to output the data in a report, you can use a calculated text box to display either the date or N/A:

    =IIf([DateField]=#01/01/03#,"N/A",[DateField])

    Replace DateField by the appropriate field name.

Posting Permissions

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