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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Creating a button in a form that will open another and close itsel



 
 
Thread Tools Display Modes
  #1  
Old November 14th, 2004, 02:14 AM
DaveC271
external usenet poster
 
Posts: n/a
Default Creating a button in a form that will open another and close itsel

Hi can somebody tell me how I can create a button in a form that will open
another and close the form in which the button was pressed. Similar to the
reguler next screen button you find in most software?
  #2  
Old November 14th, 2004, 02:59 AM
Phil
external usenet poster
 
Posts: n/a
Default

Simply create a form using form wizard
1) select button from toolbar
2) You will be able view command as openform
3) select form that need to be opened

However, while view code:
Be sure insert DoCmd.Close before DoCmd.OpenForm

That will close main form and will open other form.

I'm still not sure why would do that.
Most program's preferences is to keep main form open.

Anyways I hope that help!
Phil

"DaveC271" wrote in message
...
Hi can somebody tell me how I can create a button in a form that will open
another and close the form in which the button was pressed. Similar to

the
reguler next screen button you find in most software?



  #3  
Old November 14th, 2004, 07:44 AM
fredg
external usenet poster
 
Posts: n/a
Default

On Sat, 13 Nov 2004 17:14:05 -0800, DaveC271 wrote:

Hi can somebody tell me how I can create a button in a form that will open
another and close the form in which the button was pressed. Similar to the
reguler next screen button you find in most software?


After you add a command button to the form, code it's click event:
DoCmd.OpenForm "OtherFormName"
DoCmd.Close acForm, Me.Name
--
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


All times are GMT +1. The time now is 09:34 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.