Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form's OpenArgs property is mysteriously blank

Status
Not open for further replies.

dgriffin

Programmer
May 26, 2001
50
US
I have modified the following code in the Switchboard form created by the Switchboard Manager add-in that comes with Access 97 to hide the switchboard form when other forms are opened:

Select Case rst![Command]

' Open a form in Add mode.
Case conCmdOpenFormAdd
Me.Visible = False
DoCmd.OpenForm rst![Argument], , , , acAdd, , Me.Name
...
End Select


and then added the following code to each form that is opened:

Private Sub Form_Unload(Cancel As Integer)

Forms(Me.OpenArgs).Visible = True

End Sub


and everything works just fine... except for one single form. I've looked it over in great detail and cannot find anything different about this one form that would prevent this code from working.

In debug mode I have confirmed that the OpenArgs value in this one form is NULL!?! This form (or any other for that matter) does not set, reset or even use the OpenArgs property in any way (other than as noted above).

What could possibly be causing this one form's OpenArgs property to be null????
 
One possibility is that the misbehaving form is hiding itself rather than closing. If a form is already open when OpenForm is called, OpenForm will make it visible, but won't change the OpenArgs! Of course, if it hides itself instead of closing, it will never get an Unload event either, so your switchboard won't reappear.

Call up this form, "close" it, and check the Window>Unhide menu option to see if it's hidden. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top