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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make the Form close after One use.

Status
Not open for further replies.

92hilux

Technical User
Jan 28, 2003
22
CA
I have a Search form, that is opened via a menu form button.

I would like the search form to only work once, then close.

IE.. after the user clicks "search", the form will open a Report, and then close itself.

Is this possible?

PS the report and all of the minor details is done.
i just wanna know how to make the form close itself?
 
Why won't this work?

>>
Private Sub Command2_Click()
DoCmd.OpenForm "frmSearchTitle", , , , , acDialog
DoCmd.Close

End Sub
>>

i want the form to close at the same time as it brings up the report. Or at least just after (either way, without user input).
 
Your code should look something like this:

function cmdSearch_OnClick
docmd.close
docmd.openReport "MyReport",(filter for report)
end function


Although the form will be closed, the function will complete its execution so the report is opened first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top