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:
However, I get an error. I am aware of this example:
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
Code:
strQryName = "qryProcessSelectCurrentLSSubform"
Forms!frmProcessSelectLSRS![frmProcessSelectLSSubform].RecordSource = strQryName
Code:
Sub cmboCompanyName_AfterUpdate()
Dim strNewRecord As String
strNewRecord = "SELECT * FROM Customers " _
& " WHERE CustomerID = '" _
& Me!cmboCompanyName.Value & "'"
Me.RecordSource = strNewRecord
End Sub
Sincerely,
Bill