Gethzerion
Registered User.
- Local time
- Today, 22:12
- Joined
- Feb 25, 2005
- Messages
- 31
K, The database I'm currently building is growing at an exponential rate, and I'm bored of typing in the same code to check if a form is loaded before opening it, and then closing down the old form. So I decided to write a vba script to do this for me
Now this doesn't work as I keep getting the message that access cannot find the form to be opened.
Any suggestions? Using Access 2000 btw.
Code:
Option Compare Database
Option Explicit
Private Sub Command0_Click()
Call Form_Switch(Forms![frm_Test_One], Forms![frm_Test_Two])
End Sub
Private Sub Form_Switch(FormIn As Form, FormOut As Form)
If CurrentProject.AllForms(FormIn).IsLoaded = False Then
DoCmd.OpenForm FormIn, acNormal
Else
Forms![FormIn].Visible = True
End If
DoCmd.Close acForm, FormOut, acSavePrompt
End Sub
Now this doesn't work as I keep getting the message that access cannot find the form to be opened.
Any suggestions? Using Access 2000 btw.