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

Pulling data from Subform text box

Status
Not open for further replies.

papernate

Programmer
Jul 9, 2003
19
US
I have a form with a sub form named "SubFormEmployees". The sub form pulls up data based upon the employee number selected from a combo box on the parent form. I need to move data back and forth between the parent and child form (the parents form is used to create payroll information). I've pulled some syntax from here and mvps.org/access, but it will not work. Here is the VBA code below:

Me!deptName = Me!SubFormEmployees.Form!deptName

I also tried:

Me!deptName.value = Me!SubFormEmployees.Form!deptName.value

I keep getting a "path cannot be found" error. I'm using Access 2002 for my frontend, and SQL Server for the backend.
 
Me.SubformEmployees!deptname should work...that's assuming the that sub form is actually called "SubformEmployees" and there's a control called deptname on the sub form. Hope that helps.

Kevin
 
Thank you! It works perfectly. To make a very long story short, this will help me solve something that has been driving my boss mad for a few weeks; the VBA code was the final piece of a very large puzzle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top