Opening a new form and closing the existing one

J

JohnB

Hi.

If I have frmForm1 containing a command button that opens frmForm2, is there
some code that I can add to the buttons On Click event so that frmForm1 does
not reappear when Form2 is closed? i.e frmForm1 is closed at the same time
that frmForm2 is opened.

Thanks, JohnB
 
6

'69 Camaro

Hi, John.
is there
some code that I can add to the buttons On Click event so that frmForm1 does
not reappear when Form2 is closed?

To make the current form close as soon as another form is opened, try:

DoCmd.OpenForm "frmForm2"
DoCmd.Close acForm, Me.Name


HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of rewarding
the contributors who have taken the time to answer questions correctly.
 
J

JohnB

That works a treat! Thanks, JohnB

'69 Camaro said:
Hi, John.


To make the current form close as soon as another form is opened, try:

DoCmd.OpenForm "frmForm2"
DoCmd.Close acForm, Me.Name


HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of rewarding
the contributors who have taken the time to answer questions correctly.
 

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

Top