So I am trying to use a button click to open the next form (in my form flow), and pass the ID to the next form using openArgs:
docmd.openform "NextForm",,,,,, MainID
docmd.close acform, "CurrentForm", acSaveYes
the second form will not open….i have never run into this problem with a docmd.openform in a sub before. however, this is my first experience using OpenArgs….usually I would pass a value to a hidden text box, but I am trying something different.
The routine runs without error, and the currentform closes just as it should. It’s like access is convinced the second form is in fact open, but its not showing up. Also if I even try to show the database objects window, and just click open the form from there…..nothing
please help!
thanks
Justin
It’s like access is convinced the second form is in fact open, but its not showing up.
If you get no error message when the form apparently fails to open, check whether NextForm is present in the Forms collection. In the Immediate Window, try:
What happens? The Forms collection includes the forms which are open. If you get an error message that NextForm isn’t found, then NextForm is not open. But, if that command returns the name NextForm, the form is open but you can’t see it.
That can happen in at least 2 ways:
If the form really does not open, and you’re not getting an error message, make sure you don’t have SetWarnings and Echo turned off.
If those suggestions don’t lead you to the cure, show us what NextForm is attempting to do with OpenArgs. Can you get NextForm to open if you temporarily disable its OpenArgs handling code?
Update: A couple more questions …
Can you open NextForm in design view?
What happens if you try the following command in the Immediate Window? Error message?