MDDNRBrian
Technical User
Hi. I'm having trouble figuring out what code to use in my subform to create an incremental variable "Tag Number" as records are added. I've tried DMAX and DLAST but can't get it to do exactly what I need.
What I have is a mainform with owner info (Permit #, name, address, etc.). I then have a subform linked by permit # that I enter individual tag information into (one to many relationship). My problem is, I need to be able to enter a number value in the Tag # column of the first subform record for a given owner, and then have Access automatically fill in Tag # + 1 as I tab through additional subform records for the given owner. Tag number series are assigned randomly for a given owner (i.e., Owner 1 may be assigned Tag 1 - Tag 50; Owner 2 may be assigned Tag 555-675, etc.).
I tried DMAX code in the default value property box, but it was acting strangely. For example, I'd enter 551 in the first record, then it would make the next 2 records 552, the next 2 records, 553, etc. Plus, it's not gauranteed that my tag numbers will be larger from one owner to the next. In other words, owner 1 may have a larger series of tags then owner 2. Essentially, I need some way to only look at the subform data for a given owner and have the Tag # + 1 process work within that owners data. Thanks for any help that can be provided. Brian
What I have is a mainform with owner info (Permit #, name, address, etc.). I then have a subform linked by permit # that I enter individual tag information into (one to many relationship). My problem is, I need to be able to enter a number value in the Tag # column of the first subform record for a given owner, and then have Access automatically fill in Tag # + 1 as I tab through additional subform records for the given owner. Tag number series are assigned randomly for a given owner (i.e., Owner 1 may be assigned Tag 1 - Tag 50; Owner 2 may be assigned Tag 555-675, etc.).
I tried DMAX code in the default value property box, but it was acting strangely. For example, I'd enter 551 in the first record, then it would make the next 2 records 552, the next 2 records, 553, etc. Plus, it's not gauranteed that my tag numbers will be larger from one owner to the next. In other words, owner 1 may have a larger series of tags then owner 2. Essentially, I need some way to only look at the subform data for a given owner and have the Tag # + 1 process work within that owners data. Thanks for any help that can be provided. Brian