Because you are specifically referring to the control, you must specify the
entire path to the control.
HOWEVER; if you pass a reference to a control and not the parts of the "path" to
the control then the control contains the entire path. So you don't have to
worry about "building" the "path" to the control.
Since you have not posted your code it is hard to say whether or not my
suggestion would work or not. I did post a small bit of sample code, that you
might be able to adapt.
Think of it this way. I hand you a glass and say fill this glass. You don't
have to ask me which glass, on what shelf, and in the front or back of the
shelf. You have the glass in your hand.
On the other hand, if I say fill a glass. You are going to ask me on what
shelf? Is it in the front or the back? Is it the third one from the front? OH!
By the way, in which cabinet? Is it in this room?
So if you can just pass a reference to the control.
Thanks for your answer..but I am got confused..
Why do i need to use this structures:
SetControl Me.ControlName
SetControl Forms!Formname!ControlName
SetControl Forms!FormName!SubFormControl.Form!
including the function SetControl just to do this:
Me.ControlName=somevalue
Forms!Formname!ControlName=somevalue
Forms!FormName!SubFormControl.Form!control=somevalue
???
What i am looking for is:
1. I have function - this function takes two arguments:
a) strFormname
b) strFormcontrol
it returns the values to the form using this structure:
a=Forms(strFormName).Controls(strFormcontrol)
Problem:
What if i use the subform with a field on it?
1. My function will take three arguments:
a) strFromname
b) strFormcontrol - at the same time a subform's name
c) strSubFormcontrol - control on subform
it returns the value to the form using what structure?
a=Forms(strFormName).Controls(strFormcontrol).Forms!???
The problem
I am doing this because i would love to use my function
everywhere..regadless what control has called it..from a
form or subform...
Thanks for your time and help...
SNIP