I'm not particularly experience with visual basic/ms access, so go easy on me 
I'm trying to write a function that opens a new form and sets certain values to those of the old form (specifically an identification number). I want both the new form name and the old form name to be arguments of function. However, I've run into problems trying to put the new form name variable into the form "path."
I'm going for something along the lines of:
Code:
Public Function ChangeForms(NewForm As String, OldForm As String)
DoCmd.OpenForm NewForm
Forms!NewForm!ID = Forms!OldForm!ID
DoCmd.Close acForm, OldForm, acSaveYes
End Function
However, in the third line NewForm and OldForm are interpreted as strings, not as variable names, so I get an error saying that the form "NewForm" could not be found. Any suggestions for how to solve this problem?
Thanks!