G
Guest
hi,
i have a piece of code which i want to automatically use to change a value
of a field once the button has pressed. the code goes to the necxt record
and is supposed to automatically fill an entry with a number.
here is the code
DoCmd.GoToRecord , , acNewRec
newDocID = DMax("[Document ID]", "[Tbl_Documents]",
"[Tbl_Documents].[Project] = Frm_Main.Project & ''") + 1
Me.[Document ID] = newDocID
The only outcome is the message "You cancelled the previous operation" but i
cant see why if the code is following through line by line, it should go to a
new record then ammend the document id accordingly.
i have a piece of code which i want to automatically use to change a value
of a field once the button has pressed. the code goes to the necxt record
and is supposed to automatically fill an entry with a number.
here is the code
DoCmd.GoToRecord , , acNewRec
newDocID = DMax("[Document ID]", "[Tbl_Documents]",
"[Tbl_Documents].[Project] = Frm_Main.Project & ''") + 1
Me.[Document ID] = newDocID
The only outcome is the message "You cancelled the previous operation" but i
cant see why if the code is following through line by line, it should go to a
new record then ammend the document id accordingly.