Can't close popup

ellenr

Registered User.
Local time
Today, 18:27
Joined
Apr 15, 2011
Messages
400
I have a popup for entering a password -- if the correct password is entered, another form opens and I want the popup to close automatically without the user having to click a close button. I get runtime error 2585 when I put DoCmd.Close acForm, "EnterPWord" in the onOpen event of the new form. I have tried various ideas and nothing works.
 
Don't use a form, use INPUTBOX.
It closes after entry.
 
Here is an example of code I use in a popup form in order to close it based on a click event but you can modify it for use in the after update event of a combobox, as well.

Code:
Private Sub btnContinue_Click()
    If DCount("Client", "tblWildCards", "Client='" & Me.cboClient & "'") > 0 Then
        Call cboClient_AfterUpdate
    Else
        DoCmd.Close ObjectType:=acForm, ObjectName:=Me.Name
    End If
End Sub
 
don't close the from from the new form.
just open the new form and close the pop-op:

docmd.OpenForm ....
DoCmd.Close acForm, Me.Name
 
Hi all: thanks for all of your help. What finally worked was moving my code to the AfterUpdate event. Yay!
 

Users who are viewing this thread

Back
Top Bottom