Hi. Trying to assign the recordset of subform B (frmRemittanceLocation) to records from a table that are related to a value in subform A (frmSupplierLocation), but the query is not returning any results (and I've validated that the data is there). Here is the code:
strSQL = "Select * From tblRemittanceLocation " & _
"Where tblRemittanceLocation!UniqueName = '" & _
Me.frmSupplierLocation!UniqueName.Value & "'"
Me.frmRemittanceLocation.Form.RecordSource = strSQL
Me.frmRemittanceLocation.Form.Requery
varLines = Me.frmRemittanceLocation!RemitToAddressPostalAddressLines.Value
This code is executed in the Current event of the main form. In the immediate window, I have exactly the SQL command that I want:
Select * From tblRemittanceLocation Where tblRemittanceLocation!UniqueName = 'PC0000016'
But the recordcount of this recordsource is 0. I'm stumped.
Thanks!
Scott
strSQL = "Select * From tblRemittanceLocation " & _
"Where tblRemittanceLocation!UniqueName = '" & _
Me.frmSupplierLocation!UniqueName.Value & "'"
Me.frmRemittanceLocation.Form.RecordSource = strSQL
Me.frmRemittanceLocation.Form.Requery
varLines = Me.frmRemittanceLocation!RemitToAddressPostalAddressLines.Value
This code is executed in the Current event of the main form. In the immediate window, I have exactly the SQL command that I want:
Select * From tblRemittanceLocation Where tblRemittanceLocation!UniqueName = 'PC0000016'
But the recordcount of this recordsource is 0. I'm stumped.
Thanks!
Scott