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

form navigation and sizing problems

Status
Not open for further replies.

kimhoong79

Technical User
Jun 10, 2002
58
MY
1.How to create a command button to open a new form and close the existing form at the same time?

2.How to set the form size to be maximized everytime it's opened?

FYI, I'm a newbie in MS Access with no VB knowledge. If possible, teach me how to solve these problems using GUI methods

Thanks in advance!
 
1.How to create a command button to open a new form and close the existing form at the same time?

To open a form, put the following code in the OnClick procedure of the button.

DoCmd.OpenForm "Form Name"

The OpenForm Method has optional arguments that follow the form name. You can do things such as set a filter, where condition, open the form as a dialog window, and pass an argument.

To close the form, use:


DoCmd.Close

This will close the window that has the focus. You can close a specific window by using:

DoCmd.Close object type, "object name"

2.How to set the form size to be maximized everytime it's opened?

Access remembers the size of the window when it was last saved. To open the form maximized, set the Form Autoresize property to No, open the form, maximize it, and save it. If you don't want the user to be able to change the size of a window, set the Form Border Style property to anything other than sizeable, maximize the form, and save it. You can also disable the Min/Max buttons on the Form Format tab.

dz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top