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!

Populate txtbox field in subsubform

Status
Not open for further replies.

cdgeer

IS-IT--Management
Apr 8, 2008
133
US
I have some code from a cmd button on a form that would normally populate a textbox field with a value from a DLookup value. However, I can't get it to work when I place the form on a tab page which is on another main form.

Private Sub cmdFindOldTable_Click()
Dim strSQL As String

strSQL = "SELECT TableName INTO y_tmpGeneral_ProcessortxtTableOld FROM y_LatestExtracts WHERE ((Mid((Forms![Extract Import Tools].Form![General_Processor]![txtTableNew]), 10, 65))=([y_LatestExtracts].[TrimmedTableName]));"

DoCmd.SetWarnings False
DoCmd.RunSQL strSQL

Me![txtTableOld] = DLookup("[TableName]", "[y_tmpGeneral_ProcessortxtTableOld]")

DoCmd.SetWarnings True

End Sub
[Extract Import Tools] is the main form. [EIT_Tab] is the subform on that and [General_Processor] is the sub subform on that.

I replaced the Me![txtTableOld] (which used to work when [General_Processor] was a stand alone form) with Forms![Extract Import Tools].Form![General_Processor]![txtTableNew] but I get an error: "Object doesn't support this property or method."
Any ideas anyone??

 
Forms![Extract Import Tools]!EIT_Tab.Form!General_Processor.Form!txtTableOld

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV. Tried it but still get "Object doesn't support this property or method." ?
 
You may use the Expression Builder to discover the correct syntax.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Not sure I follow how the expression builder would help. Isn't that for queries?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top