How to hide a form?

  • Thread starter Thread starter news2
  • Start date Start date
N

news2

First my apologies! I seem to have had my news reader filter set so that I
missed not only my original message but any responses I may have received.
If there is an archive I'd be glad to look there - but if not I'd sure
appreciate it if any replies would be resent. I suspect my embarrassment
exceeds your irk level!

----------------
I have a dialog form which, when exited, refuses to close until the
following process is completed. I have tried
DoCmd.Close acForm, "PasswordEntryForm"
to no avail.

Now it would be fine if I could at least HIDE it so the user could see the
status info that's appearing beneath it.

Dick Cleaveland
 
First my apologies! I seem to have had my news reader filter set so that I
missed not only my original message but any responses I may have received.
If there is an archive I'd be glad to look there - but if not I'd sure
appreciate it if any replies would be resent. I suspect my embarrassment
exceeds your irk level!

Go to http://groups.google.com and use the Advanced search to search for your
post.
----------------
I have a dialog form which, when exited, refuses to close until the
following process is completed. I have tried
DoCmd.Close acForm, "PasswordEntryForm"
to no avail.

Now it would be fine if I could at least HIDE it so the user could see the
status info that's appearing beneath it.

Dick Cleaveland

Where is this code being executed? When you open a form in Dialog view, all
code execution STOPS until some event on that form itself either closes the
form, or sets its Visible property to False.

John W. Vinson [MVP]
 
First, thanks for the pointer to the google archive search. I will make much
use of it!

And thanks for the several suggestions. Here's what may be an interesting
evolution:

The code I'm executing is in the dialog form itself, and it triggered by a
command button "finished".

When I try

Private Sub Finished_Click()
Me.Visible = False
SitePassword = PasswordEntered
SitePasswordValid = True
DoCmd.Close acForm
End Sub

I get the error "This object requires an object name argument." on the
docmd.

When I try (as suggested in the help system):

Private Sub Finished_Click()
Me.Visible = False
SitePassword = PasswordEntered
SitePasswordValid = True
DoCmd.Close(acForm,"PasswordEntryForm",acSavePrompt)
End Sub

The system balks with "Expected =". and a syntax error on compile.

When I try:

Private Sub Finished_Click()
Me.Visible = False
DoEvents
SitePassword = PasswordEntered
SitePasswordValid = True
DoCmd.Close acForm
End Sub

I get

"This object requires an object name argument." on execution.

I finally got it by removing the docmd.:

Private Sub Finished_Click()
Me.Visible = False
DoEvents '<<<<<<<<<<<<< works with or without this
SitePassword = PasswordEntered
SitePasswordValid = True
Close acForm '<<<<<<<<<<<<<<<<<<<<
End Sub

This works!

Dick Cleaveland
 
First, thanks for the pointer to the google archive search. I will make much
use of it!

And thanks for the several suggestions. Here's what may be an interesting
evolution:

The code I'm executing is in the dialog form itself, and it triggered by a
command button "finished".

When I try

Private Sub Finished_Click()
Me.Visible = False
SitePassword = PasswordEntered
SitePasswordValid = True
DoCmd.Close acForm
End Sub

I get the error "This object requires an object name argument." on the
docmd.

You can use:

DoCmd.Close acDataForm, Me.Name

or (as you found) just the ambiguous DoCmd.Close (which closes whatever object
has the focus).

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top