vicsar
https://about.me/vicsar
- Local time
- Today, 08:54
- Joined
- Jul 25, 2012
- Messages
- 35
Hello,
I have this code:
it works fine under frm_Input_Form but I have other forms that could use this code as they use the same criteria to determine which parameter code (number) is being affected. I know I could replace frm_Input_Form with the name on the other form but I do not want to do that as it is cumbersome I rather make a call from each form to a procedure in a module and have it update the cboParameter_affected combo box.
How can that be achieved?
How can I reuse code in different forms when the only variable is the form name? (This is driving me crazy)
P.s.: I tried using the ActiveForm property (.Name) to no avail. Following is a some sample code:
Thanks, looking forward to your reply.
I have this code:
Code:
[FONT=Verdana][SIZE=2] If Forms!frm_Input_Form.[Process_Name] = "Process1" And Forms!frm_Input_Form.[Thread] = "Thread1" And Forms!frm_Input_Form.[Affected_Parameter1] = "Time" Then
Forms!frm_Input_Form.[CCRP_Parameter_Number] = "Parameter_Code_1"
Forms!frm_Input_Form.cboParameter_affected.Requery
[/SIZE][/FONT]
it works fine under frm_Input_Form but I have other forms that could use this code as they use the same criteria to determine which parameter code (number) is being affected. I know I could replace frm_Input_Form with the name on the other form but I do not want to do that as it is cumbersome I rather make a call from each form to a procedure in a module and have it update the cboParameter_affected combo box.
How can that be achieved?
How can I reuse code in different forms when the only variable is the form name? (This is driving me crazy)
P.s.: I tried using the ActiveForm property (.Name) to no avail. Following is a some sample code:
Code:
Dim frmCurrentForm As Form
Set frmCurrentForm = Screen.ActiveForm
MsgBox "Current form is " & frmCurrentForm.Name
Thanks, looking forward to your reply.