I'm trying to write a simple subroutine that will automatically create a number in a data object on a form. The new number will be generated by taking the last value that was saved to the table from that object and incrementing it by +1.
db = WARN_Vers11.mdb
tbl = WARNData
tblfield = NoticeNo
frm = frmDataEntry
object = txtNoticeNo
When frmDataEntry is opened I want the program to look at the value of NoticeNo in the last record of the table, then populate txtNoticeNo with that value +1.
For example, if the NoticeNo for the last record in the table is 3595, when I open frmDataEntry to enter a new record the txtNoticeNo box should automatically be populated with 3596.
I'm not so good with subroutines that require me to define recordsets, etc. Any help you can provide will be greatly appreciated.
db = WARN_Vers11.mdb
tbl = WARNData
tblfield = NoticeNo
frm = frmDataEntry
object = txtNoticeNo
When frmDataEntry is opened I want the program to look at the value of NoticeNo in the last record of the table, then populate txtNoticeNo with that value +1.
For example, if the NoticeNo for the last record in the table is 3595, when I open frmDataEntry to enter a new record the txtNoticeNo box should automatically be populated with 3596.
I'm not so good with subroutines that require me to define recordsets, etc. Any help you can provide will be greatly appreciated.