Hi Everyone,
I'm an absolute novice at best with Access but am trying to learn.
I am running the code below on a button in a filtered form. What I would like to do is run it after my last field is entered IN THE FIRST RECORD and I press the ENTER key
creating a new record. In addition in the SLOT field of the first record we I enter "1". What I would like it to do is in the 2nd record, be 2, third record 3, etc.
Thanks a bunch!!
I'm an absolute novice at best with Access but am trying to learn.
I am running the code below on a button in a filtered form. What I would like to do is run it after my last field is entered IN THE FIRST RECORD and I press the ENTER key
creating a new record. In addition in the SLOT field of the first record we I enter "1". What I would like it to do is in the 2nd record, be 2, third record 3, etc.
Thanks a bunch!!
Code:
Dim ID As Long
ID = DMax("ProductID", "Table1")
DoCmd.GoToRecord , , acNewRec
Slot = DLookup("Slot", "Table1", "ProductID=" & ID)
Associate = DLookup("Associate", "Table1", "ProductID=" & ID)
DateEntered = DLookup("DateEntered", "Table1", "ProductID=" & ID)
Scan.SetFocus
Last edited: