I use the "DoCmd.OpenForm stDocName, , , stLinkCriteria, , , JobID & ProjectName" to open a form with the parameters passed in OpenArgs variable. The OpenArgs variable contains the expected data. Then later in the program run, I want to open the form with a different "JobID". When I call the DoCmd.OpenForm.... command (same as above, except with a different Job ID), I don't get the expected data. I get the previous OpenArgs data.
Example: I call DoCmd.OpenForm with OpenArgs = "TP01", the form opens and I display me.openargs in a message box (it displays "TP01"). When I call DoCmd.OpenForm with OpenArgs = "TP02" and display it in the msgbox, I get "TP01" again. It should be TP02.
I tried calling DoCmd.close but that makes no difference. Does anyone know what I am doing wrong when I use the OpenArgs property?