Results 1 to 3 of 3
  1. #1
    LaserSailor is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2015
    Posts
    2

    auto populate date value when editing records on a forum?

    I have what seems to be a simple question but no luck finding an answer in the archives.

    I have a continuous form (for conducting parts inventory) which a user will use to edit a couple of fields and have set the Tab Order to skip over certain fields to discourage editing



    • The user will edit the QtyOnHand
    • there is a field called Count_Date which I would like to be automatically fill with the the present time when that control Gets Focus.
      • to achieve this goal,
        • the On Got Focus property of the Count_Date field/control on the form is = Now()
        • the Format property of the control is Long Date

      • this works perfectly if I add a New Record at the bottom of the form, in fact the date value is already in place for a new record but nothing happens when the focus moves to the Count_Date control when editing existing records
      • the reason for the Count_Date field is to enable tracking the editing of the records.
      • the datasource for the form is a query: SELECT Inv.LOCATION, Inv.PARTNO, Inv.PARTDESC, Inv.ALTPARTNO, Inv.ON_HAND, Inv.Count_DateFROM Inv
        WHERE (((Inv.LOCATION) Like "a*"))
        ORDER BY Inv.LOCATION, Inv.PARTNO;

    • in attempting an easier solution, I added a YesNo field Counted thinking that the user could simply check the field when it was counted but if one clicks the checkbox, it applies the check box to all records. Clearly I am missing some fundamental issues.
    • LATEST UPDATE: I created a copy of the same form with the datasource based on the underlying table instead of the query cited above and at least the check box action applies to the specific record so that is a viable solution.
      • the autofill of the Count_Date function does not work when the cursor lands on that control despite the properties assigned.

    Suggestions? Thanks in advance
    Last edited by LaserSailor; 01-27-2015 at 06:05 PM. Reason: to update changes and better explain

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I don't understand what you mean about setting the GotFocus property to =Now(). I just tested this and does not populate the field even for new record. Does nothing. This expression should not be in the event property. Need VBA or macro. Select [Event Procedure] then the VBA code would be:

    Me!Count_Date = Now()
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    LaserSailor is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2015
    Posts
    2
    thank you for the reply.

    I clearly don't know enough about what I am doing and don't feel it's responsible or considerate to ask these fundamental questions to the group. I will simply use the form which has the table as its data source and the checkbox field / control

    Stay warm and thanks for taking the time to moderate the forum

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

Similar Threads

  1. Replies: 1
    Last Post: 08-05-2014, 12:40 PM
  2. Auto-populate fields in appended records
    By FinChase in forum Access
    Replies: 2
    Last Post: 06-17-2014, 10:23 AM
  3. Auto populate text from date
    By losingmymind in forum Access
    Replies: 4
    Last Post: 05-30-2013, 10:39 AM
  4. Auto populate date field in payment table
    By jeffrey.ccs in forum Access
    Replies: 4
    Last Post: 11-08-2012, 04:44 PM
  5. Replies: 12
    Last Post: 08-30-2011, 03:36 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