A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Close form after report opens?



 
 
Thread Tools Display Modes
  #1  
Old August 24th, 2005, 11:09 PM
Randy
external usenet poster
 
Posts: n/a
Default Close form after report opens?

I have a form with a txbox to enter the date and a cmd button which opens a
report. I would like the form to automatically close when the report opens.
When the user closes the report I would like the form to be
closed..Thanks...Randal


  #2  
Old August 24th, 2005, 11:47 PM
fredg
external usenet poster
 
Posts: n/a
Default

On Wed, 24 Aug 2005 15:09:43 -0700, Randy wrote:

I have a form with a txbox to enter the date and a cmd button which opens a
report. I would like the form to automatically close when the report opens.
When the user closes the report I would like the form to be
closed..Thanks...Randal


Leave the form open while the report runs.
Code the Report Close event:

DoCmd.Close acForm, "FormName"

When the report closes it will close the form.

Pehaps a better method would be to let the report itself open the
form.
In addition to coding the report's Close event, as above, do the
following.

Code the Report Open Event:
DoCmd.OpenForm "FormName", , , , , acDialog

Code that command button on the form:
Me.Visible = False

Now all you need do is open the report (not the form).
When the report opens, it will open the form.
After the date has been entered in the form click the command button.
The form will become not visible, and the report will display.
When you close the report, it will also close the form.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
  #3  
Old August 25th, 2005, 01:42 AM
Randy
external usenet poster
 
Posts: n/a
Default

Perfect. That was easy, Thanks a lot..
"fredg" wrote in message
.. .
On Wed, 24 Aug 2005 15:09:43 -0700, Randy wrote:

I have a form with a txbox to enter the date and a cmd button which opens
a
report. I would like the form to automatically close when the report
opens.
When the user closes the report I would like the form to be
closed..Thanks...Randal


Leave the form open while the report runs.
Code the Report Close event:

DoCmd.Close acForm, "FormName"

When the report closes it will close the form.

Pehaps a better method would be to let the report itself open the
form.
In addition to coding the report's Close event, as above, do the
following.

Code the Report Open Event:
DoCmd.OpenForm "FormName", , , , , acDialog

Code that command button on the form:
Me.Visible = False

Now all you need do is open the report (not the form).
When the report opens, it will open the form.
After the date has been entered in the form click the command button.
The form will become not visible, and the report will display.
When you close the report, it will also close the form.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ECHO Causing Problems DS General Discussion 5 May 17th, 2005 02:19 AM
Need Help In Printing Current Record in Specific Report RNUSZ@OKDPS Setting Up & Running Reports 1 May 16th, 2005 09:06 PM
Help!! I'm running around in circles! CathyA New Users 19 December 12th, 2004 07:50 PM
dlookup miaplacidus Using Forms 9 August 5th, 2004 09:16 PM
auto entry into second table after update Tony New Users 13 July 9th, 2004 10:42 PM


All times are GMT +1. The time now is 12:31 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.