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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to reference a subform control?tried it all, no dice, HELP

Status
Not open for further replies.

b31luv

Technical User
Feb 21, 2002
171
US
I'm losing my mind and I feel like jumping out a window. I've looked through about 150 threads I keep running across this code

forms![Form]![SubForm]![control]

It claims that I can use it to access controls in the subform. I haven't had any success. It keeps telling my it doesn't recognize my subform. The nerve of this Dbase. It's there, I know it's there. I just want to make this dbase know that it's there. Help......
 
The syntax for referencing a control on a subform is:

forms![Form]![SubForm].Form![control]

So if you have a control called txtYourControl on a subform called frmMainSub which is on a main form called frmMain, then the reference to the control would be:

Forms!frmMain!frmMainSub.Form!txtYourControl

Hope this sorts out the problem,






Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
 
Sorry for bugging you yesterday, but I used the syntax you suggested and had the same problems. However, being alive and revived this morning, I found the problem, I was using the wrong subform name and control name because I renamed them. Oops

Thanks for your assistance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top