I am having trouble with some code. I know how to write the expression in access but I can't figure out how to translate it to VBA. I listed the code below. The Val portion extracts just the numbers from [Boxes].[OldBox#]. Then DMax finds the highest number and adds 1 to it. Lastly, the current record will be set to that number. Thank you for your help.
Me.[OldBox#]=DMax("Val([OldBox#])","[Boxes]")+1