AutoPopulate Field On new Record

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Master810
    New Member
    • Aug 2012
    • 1

    AutoPopulate Field On new Record

    I have an Access form. In this form I have a date textbox and I want AfterUpdate on textbox to autopopulate the field of employeesid from the previous record which I manually filled already.
    Last edited by NeoPa; Aug 20 '12, 12:51 AM. Reason: Rewrote in acceptable English. Please use decent English for all future posts or they will be removed.
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    carry down prior record's values to new record.

    @Master810


    Welcome to the bytes forum!

    Normally we'd also like to see any code that you may have already attempted; however, please remember to enclose the code within the [code] [/code] code tags.

    This is a tricky bit of magic and not as straight forward as one would think: http://support.microsoft.com/kb/210236

    I've use a version of this on several forms.

    Before you post more questions please take the time to read the following: Posting Guidelines
    How to ask good questions
    FAQ

    Here are few links that will answer a good number of questions and other issues:
    A Tutorial for Access
    Database Normalization and Table Structures.
    access insights
    Especially 161.Example Filtering on a Form.

    -z
    Last edited by zmbd; Aug 18 '12, 11:32 PM.

    Comment

    • TheSmileyCoder
      Recognized Expert Moderator Top Contributor
      • Dec 2009
      • 2322

      #3
      I think the easiest approach would be to use the AfterUpdate Event of the EmployeeID control, to store the last entered EmployeeID as the default value for that control.

      This does not exactly meet your requirements of doing it after the update of the Date field, but I think it will fullfill your needs fine, and with alot less effort.

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        Carry forward or Store Default

        Originally posted by TheSmileyCoder
        I think the easiest approach would be to use the AfterUpdate Event of the EmployeeID control, to store the last entered EmployeeID as the default value for that control.
        Perhaps I read the OP incorrectly; however, from both the OP and NeoPa's rewrite, I am still under the impression that the desire was to carry the value from prior record to the new record.
        Perhaps Master810 can clarify the desired actions?
        -z

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32633

          #5
          No matter how many ways you read it Z, the question makes no actual sense.

          My best guess is that the OP wants any new records to be populated with the same value as the record entered just prior to the new record. In that sense, I suspect that Smiley's suggestion is a (possibly the only) viable approach to follow.

          Comment

          • zmbd
            Recognized Expert Moderator Expert
            • Mar 2012
            • 5501

            #6
            ms site in #2 will do this.
            I'm starting to wonder if OP, DB is normalized.
            -z

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32633

              #7
              Although that goes into much more detail, and even provides some code as an example of how to use it, it's fundamentally the same concept. Sure it should work, but it's not a different approach.

              Except for the Ctrl-Apostrophe (^') that is. That doesn't quite answer the question as I see it (and like everyone-else I'm using intelligent guesswork on that front), but is certainly an interesting concept. One of which I was previously unaware to boot (and I love learning new approaches).

              Good work anyway - to both of you :-)

              Comment

              Working...