|
-
Jul 18th, 2005, 02:45 PM
#1
Thread Starter
Fanatic Member
Help Routing Between Forms
I have a form named 'FrmCustomers' which contains a list box containing customers names, allowing the user to choose a customer to view ,edit etc.
This form may be loaded from a number of different forms within the app
i.e. assuming the app is in main form 'FrmMain' - to load customer form I use the following code:
Private sub CmdLoadCust_Click
Origin=Me.Name 'This is used to determine the original form
Me.Enabled=False
FrmCustomers.Show
End Sub
Now to return to the original form I put the following code in the form Unload event of the form 'FrmCustomers' :
Private Sub Form_Unload(Cancel As Integer)
if Origin="FrmMain" then FrmMain.Enabled=True
If Origin="Frm1"then Frm1.Enabled=True
If Origin="Frm3" then Frm3.Enabled=True
End Sub
etc. etc. etc.
My question is :
Is there not an easier way to return to the form which loaded FrmCustomers in the first place ?
Pse Help!!!
Ken
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|