Hay everyone and happy holidays....
I have a question and maybe you have a better solution then the way I am going about it.
I have vba code that based on a form sets some checkbox to true. The problem is I have several forms that use this same code so I have written several versions of this code changing the form name in each of them. I would like to use just one code and based upon the Form that is currently Active or Open plug that variable throughout. This is what works:
Dim Frm As Form
Set Frm = Screen.ActiveForm
MsgBox Frm.Name 'this tells me my form name that I am looking for.
What is not working is this next part:
Forms![Frm.name]![ChkCHF] = True
Acess sees Frm.name as the actual name of a form instead of the variable.
Thanks in advance for your help
Kim
I have a question and maybe you have a better solution then the way I am going about it.
I have vba code that based on a form sets some checkbox to true. The problem is I have several forms that use this same code so I have written several versions of this code changing the form name in each of them. I would like to use just one code and based upon the Form that is currently Active or Open plug that variable throughout. This is what works:
Dim Frm As Form
Set Frm = Screen.ActiveForm
MsgBox Frm.Name 'this tells me my form name that I am looking for.
What is not working is this next part:
Forms![Frm.name]![ChkCHF] = True
Acess sees Frm.name as the actual name of a form instead of the variable.
Thanks in advance for your help
Kim