I'm trying to get data from the last record change it and then place it into a new record.
I've tried the following and I can get the data and change it but I can't get it into a new record
Function AddRec()
DoCmd.OpenTable "OBCImages", acViewNormal, acEdit
DoCmd.GoToRecord , "", acLast
ValLocNum = DLast("LocNum", "OBCImages") + 1
MsgBox (ValLocNum) ' to see if it took
DoCmd.GoToRecord , "", acNewRec
LocNum = ValLocNum
DoCmd.Save
End Function
I've tried the following and I can get the data and change it but I can't get it into a new record
Function AddRec()
DoCmd.OpenTable "OBCImages", acViewNormal, acEdit
DoCmd.GoToRecord , "", acLast
ValLocNum = DLast("LocNum", "OBCImages") + 1
MsgBox (ValLocNum) ' to see if it took
DoCmd.GoToRecord , "", acNewRec
LocNum = ValLocNum
DoCmd.Save
End Function