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

Change Variable form recordsource 1

Status
Not open for further replies.

hartwell

Technical User
Apr 18, 2005
80
GB
Hi Guy's

Trying to change a variable form's record source

here is what i have (ive only included what is needed)

Dim strSubFormName As String

strSubFormName = Forms![frmIndex].txtSearch.Tag

rs = "(SELECT * FROM tblMatrixCoreData WHERE tblMatrixCoreData.Accountno = " & strSearchValue & ")"

Forms![frmIndex]![strSubFormName].RecordSource = rs

i just get field strsubformname not found
 
Perhaps something like this ?
rs = "SELECT * FROM tblMatrixCoreData WHERE Accountno=" & strSearchValue
Forms![frmIndex].Controls(strSubFormName).Form.RecordSource = rs

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top