O
ortaias
The following line works, as hard code. The variable "CallingForm"
holds the name of the form that activated a second form. The "hard
code" is the refrence to "pending4frm" in
"Forms![pending4frm].SetFocus"
If Not IsNull(CallingForm.Value) Then Forms![pending4frm].SetFocus
The problem with the code above is that it is tied to a specific form
"pending4frm"; it needs to be adaptable. I tried the code below, but
that did not work.
formname = "Forms!" & [CallingForm] & ".setfocus"
Not IsNull(CallingForm.Value) Then formname
I also tried the code below, and that did not work either
With CallingForm
If Not IsNull(CallingForm.Value) Then .SetFocus
End With
Any solutions?
holds the name of the form that activated a second form. The "hard
code" is the refrence to "pending4frm" in
"Forms![pending4frm].SetFocus"
If Not IsNull(CallingForm.Value) Then Forms![pending4frm].SetFocus
The problem with the code above is that it is tied to a specific form
"pending4frm"; it needs to be adaptable. I tried the code below, but
that did not work.
formname = "Forms!" & [CallingForm] & ".setfocus"
Not IsNull(CallingForm.Value) Then formname
I also tried the code below, and that did not work either
With CallingForm
If Not IsNull(CallingForm.Value) Then .SetFocus
End With
Any solutions?