Hi,
I've been trying to figure a way to minimize my code in a module. I currently have three function built excalty the same way to work with three different forms. Each textbox in all the forms are named the same now what I'm trying to do is have the function identify which form called the function and where should the data be. I currently have no coding for it since I have no idea how to even start with this and I've looked all over the place and I can't find my answer.
The plan is
Identify wich form was it requested from. I'm using this right now since this is the easiest I've found.
Once that is found.
have something like this.
This should make me be able to do
No matter if all three forms are open the data should only go to the one that declared the function.
Please help I've been trying to figure this out for too long.
I've been trying to figure a way to minimize my code in a module. I currently have three function built excalty the same way to work with three different forms. Each textbox in all the forms are named the same now what I'm trying to do is have the function identify which form called the function and where should the data be. I currently have no coding for it since I have no idea how to even start with this and I've looked all over the place and I can't find my answer.
The plan is
Identify wich form was it requested from. I'm using this right now since this is the easiest I've found.
Code:
Dim frmCurrentForm As Form
Set frmCurrentForm = Screen.[B]ActiveForm[/B]MsgBox "Current form is " & frmCurrentForm.Name
Once that is found.
have something like this.
Code:
Select Case frmCurrentForm.Name
Case 1
WorkForm = Form1
Case 2
WorkForm = Form2
End case
This should make me be able to do
Code:
WorkForm.NameField = "John Smith"
No matter if all three forms are open the data should only go to the one that declared the function.
Please help I've been trying to figure this out for too long.