Opening and Closing forms

robertlevine

Registered User.
Local time
Today, 00:46
Joined
Oct 8, 2003
Messages
24
I'm having a bit of trouble opening and closing forms...

I have 1 form, called "FORMLIST", that when I click on a button, should open a 2nd form "FORMDETAIL", and close itself ("FORMLIST") so that only "FORMDETAIL" remains.

sform$ = FORMDETAIL

So the event does:

DoCmd.OpenForm sform$
DoCmd.Close

and the FORMDETAIL closes, and not the FORMLIST.
 
When you open FORMDETAIL that becomes the current form. Then you ran the command to close whatever the current object is, which is still FORMDETAIL. You need to specify which form you want to close - OR - you can put the close command first. That should close the current form (FORMLIST) and then open the specified form (FORMDETAIL).
 
This is better...

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

Users who are viewing this thread

Back
Top Bottom