Results 1 to 10 of 10
  1. #1
    tatihulot is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    60

    How to Create a Text Box that Shows When a Record is Entered...=(NOW) Doesn't Do That

    Hello, everyone, I am using Access 2013.



    My problem has to do with time stamps. I want a text field in my main form that displays the date and time a record was originally entered into my database.

    I created a text field and used the NOW function in it.

    =(Now)

    I have entered 340 records into my database. Only now did I notice the Timestamp text box displays the CURRENT date and time, no matter when the record was actually entered.

    Clearly, I misunderstood what the =(NOW) command does.

    So, I removed the NOW command from the text box, and went into Design mode. In the Header/Footer section of the ribbon is an option for Date and Time. I selected the formatting I wanted, but couldn't get that information into the text box. Obviously, it is meant specifically for headers and footers.

    My question should be obvious: What do I use to get a timestamp that displays when the record was originally entered into the database? I've done research into this and haven't gotten past the two things I mentioned.

    The second question is: Can I enter the date and time of my choice for the first 340 items, since I kept a journal of when I entered that information, and let Access resume putting in the timestamp with new records? I am going to have to enter the date and time for the first 340 records, but I want Access to enter the current timestamp beginning with record 341. And these records have to remain permanent and not reflect the current time.

    Thank you! T. Hulot

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Use Now() in the default value property of the field.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    tatihulot is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    60
    Nope, sorry, that isn't working.

    Is this a bug with Access 2013? Is something wrong with my computer that's causing Access to display only the current time?

    Anything else I can try?

  4. #4
    tatihulot is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    60
    Here's my database. If the database works properly on your computer, then something must be wrong with mine.
    Attached Files Attached Files

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Putting "=Now()" as the control source will ALWAYS display the current date/time.

    Putting "=Now()" in the default value property of the field/control enters the date/time in the text box ONLY on NEW records.
    You will have to enter the date/time in the currently entered records.

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    The text box "Text35" is unbound. To save the date/time, it must be bound to a field in a table. It looks like thetext box shoule be bound to the field "Time". "Time" is a very poor name. It is a reserved word in access. Also, it is not very descriptive. "Time" of what? When the DVD was produced?
    "TimeStamp" would be a better name or maybe even "WhenEntered".


    BTW, EVERY code page should have
    Code:
    Option Compare Database
    Option Explicit
    as the first two lines


    PS....... I added a date/time to the first artist record as a test

  7. #7
    tatihulot is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    60
    I was just about to ask you if the date/time needs to be bound to a field in a table, or if it can be unbound.

    Don't worry about the label being simply named TIME. That was a placeholder. I just plopped that label in to test the timestamp. The final label will be more descriptive, while remaining simple.

    I cannot open your mdata Mod file because Access 2013 displays a dialog box that says, "The Microsoft Access database engine stopped the process because you and another user are attempting to change the same data at the same time."

    So, I must ask you this question, until I can open your .mdb file: When I create the field in the table for the timestamp, I understand I must put =NOW() in the default value. But I am not sure what format the field should be. Should it be set specifically for date/time, or can it be a short text field?

    Thanks again!

  8. #8
    tatihulot is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    60
    I think I got it working properly. Yes, the timestamp works only with new records, but I figured out how to enter the date in for older records. It will be a time-consuming process, but at least it seems to be working properly.

    I created a field in the table, named TIMESTAMP and set it to Date/Time. I entered =NOW() in the Default Value field properties, and then set the Format to General Date.

    Seems to be working so far. I will let you know if I run into any snags. Thanks again for the help. The good news is that I now understand the difference between unbound and bound fields.

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Glad you got it working. Date/Time was the correct choice of data type.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I cannot open your mdata Mod file because Access 2013 displays a dialog box that says
    I can't open it either. But you sent it as .mdb.

    The mdb format is Access 2000 - 2003. You should really convert it to the accdb format (2007 - 2013).

    Glad you figured it out...... What Paul said...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 03-06-2015, 01:13 PM
  2. Replies: 2
    Last Post: 09-24-2014, 05:19 PM
  3. Replies: 6
    Last Post: 01-24-2013, 10:02 PM
  4. Text box shows ID field and not the Name
    By jzacharias in forum Access
    Replies: 5
    Last Post: 10-18-2012, 10:24 AM
  5. Replies: 12
    Last Post: 12-17-2010, 05:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums