Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Accessing Subform Control in eval()

Status
Not open for further replies.

lingyi

Programmer
Apr 11, 2001
65
SG
I trying to using eval() on one of the control in my subform via the main form as below:
ls_RuleStr = "Me.sfrmTransactionItems!txtSumofQty"
MsgBox Eval(ls_RuleStr)
Yet it give me the error :can't find the name 'Me' you entered in the expression.
I try again in accessing the control in parent form and it working fine. Does anyone know why ?

Thanks.
 
Me!subformcontainername.form.subformcontrolname


Note that container name is just that: The name of the container. It is not the subform name.
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Hi,
I tried before yet it still prompt me the same error, any idea?
 
I set up a similar test to what you have done, and eval is having a difficult time interpreting “me” so that eval(“me.childform.form!city”) causes an error attempting to interpret “me”. Since in this construct “me” is simply part of a text string and is not evaluated as a control.

However, this works very well:

?eval("forms!frmeditclient.childform.form.city")
Longwood

I think you are construing the subform container as the subform name. That will not work.

In the above example, “childform” is the name of the container on the main form which holds the subform. The name of the subform is “frmaddressdetail. Notice that “frmaddressdetail” is not a part of the eval string.
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top