Carry forward incremental values in datasheet form entry (1 Viewer)

sal

Registered User.
Local time
Today, 12:27
Joined
Oct 25, 2009
Messages
52
I am hoping to save my data entry staff a lot of time entering long ID numbers for genetic samples in our database. I have been able to carry forward values in forms in datasheet view, but I'm having trouble figuring out how to carry forward a sequential alpha numeric code with an incremental value.


For example, if a label is entered, say 19DYS001, I would like it to autofill on the next record with 19DYS002, 19DYS003, etc. until the field is edited to a null value, at which point there would be no further entries until another code is entered.


Excel seems to be able to carry forward a sequential alpha numeric code with a drag down feature. Is there a way to accomplish something like this in access? Thanks.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:27
Joined
Oct 29, 2018
Messages
21,358
Hi. The usual approach I use to do something similar is use the control's AfterUpdate event and set its DefaultValue property. But in your case, you might have to use the Current event, I guess. You can then check if you're on a New Record and then assign the next number value to the control. Of course, you'll have to cancel it later, if the user is actually done entering samples data.
 

Users who are viewing this thread

Top Bottom