Changing RecordSource to Query Name

Bill Bisco

Custom User Title
Local time
Today, 15:10
Joined
Mar 27, 2009
Messages
92
I would like my code to work like this:

Code:
strQryName = "qryProcessSelectCurrentLSSubform"
Forms!frmProcessSelectLSRS![frmProcessSelectLSSubform].RecordSource = strQryName
However, I get an error. I am aware of this example:

Code:
Sub cmboCompanyName_AfterUpdate()     
Dim strNewRecord As String     
strNewRecord = "SELECT * FROM Customers " _         
& " WHERE CustomerID = '" _         
& Me!cmboCompanyName.Value & "'"     
Me.RecordSource = strNewRecord 
End Sub
Is there any way to change the record source of a form to a specific query without copying the query's SQL code?

Sincerely,
Bill
 
My goodness, I'm such a noob. :o

Thanks,
Bill
 
No problem; we all do it.
 

Users who are viewing this thread

Back
Top Bottom