Previous Form Button???

alexi

Registered User.
Local time
Today, 16:44
Joined
Feb 26, 2003
Messages
65
Is there a length of code that can be used to create a button that opens the previous form. I have a hierachy from the switchboard which opens up An AddForm and a EditForm. However in each of these its the same form being opened up but in different modes, acEdit and acView. So i cant just say docmd.openform "AddForm" or "EditForm" i need the previous form.
Possible?
 
When I open a form, I save the name of the previous form in the (new) form tag property.

Then when I close a form, I check the active form's tag property for the name of the previous form and open it.
 
?

thanks for that but im sorry i dont understand to be frank. :)
are these properties in the form? or does this require Code Behind Form?
 
Yes to both questions.

'when opening new form
docmd.openform "frmNewForm"
'save previous form name in tag
forms!frmNewForm.tag=me.formname


'when closing new form to return to previous form
docmd.close
'open previous form, name is in tag
docmd.openform me.tag
 
Last edited:

Users who are viewing this thread

Back
Top Bottom