This will work good. Do the following on your first form:
==========
On the button that closes the form
1) Put the following line of code (change the red part to the name of your button):
Call HandleForms(Me.cmdNextForm.Tag)
2) Put a 1 in the "Tag" property of the button
==========
Now do the same thing on each form, giving it a different tag number. It doesn't matter if the Tag numbers are in the same order as the forms have to open, just so long as they are all different.
Next, put the following code in a module:
============================================
Public Sub HandleForms(frmNumber As Integer)
Select Case frmNumber
Case 1
DoCmd.OpenForm "Form2"
DoCmd.CLOSE acForm, "Form1"
Case 2
DoCmd.OpenForm "Form3"
DoCmd.CLOSE acForm, "Form2"
Case 3
DoCmd.OpenForm "Form4"
DoCmd.CLOSE acForm, "Form3"
Case 4
DoCmd.CLOSE acForm, "Form4"
End Select
End Sub
============================================
If you add a form, simply give the button on the new form, the next tag number, and add one case to the select case (again, it doesn't have to be in the same order as the forms open, as you handle what form opens and closes in the sub routine).
Now if you edit forms, the only place you have to change any code is in this module, you never have to touch the button code again, unless of course you want to put other code there.
Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?