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.
AutoPopulate Field On new Record
Collapse
X
-
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.
-zLast edited by zmbd; Aug 18 '12, 11:32 PM. -
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
-
Carry forward or Store Default
Originally posted by TheSmileyCoderI 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 Master810 can clarify the desired actions?
-zComment
-
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
-
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
Comment