I have a main form with an unbound combo box. I also have a subform showing records in datasheet view.
on the after_update event of the combobox I want to filter the subform. Here is my code (note frmqrysubmittals is the subform and the recordsource for the subform is initially the RS1 portion of code):
When I update the cbo box the subform doesn't display any records. When I go to design view and look at the record source it displays the RS1 portion (the original RS), but all of the terms are placed in brackets [].
Note, the subform and contorl are both named frmqrySubmittals.
I've been at this for days. What am I doing wrong?
Thank you everyone for your help. This group has been a great resource over the past few months as I stuble through learning Access.
on the after_update event of the combobox I want to filter the subform. Here is my code (note frmqrysubmittals is the subform and the recordsource for the subform is initially the RS1 portion of code):
Code:
Dim RS1 As String
Dim RS2 As String
Dim RS3 As String
RS1 = "SELECT tblSubmittals.SubmittalID, tblSubmittals.Format, tblSubmittals.[Specification Section], tblContractorInfo.Contractor, tblSubmittals.[Project Number], tblSubmittals.Description FROM tblContractorInfo INNER JOIN tblSubmittals ON tblContractorInfo.ContractorID = tblSubmittals.ContractorID"
RS2 = " WHERE (((tblContractorInfo.Contractor)=" & Chr$(34) & Me.cboContractor.Value & Chr$(34) & "));"
rs3 = RS1 & RS2
Me.frmqrySubmittals.Form.RecordSource = rs3
me.frmqrySubmittals.form.requery
When I update the cbo box the subform doesn't display any records. When I go to design view and look at the record source it displays the RS1 portion (the original RS), but all of the terms are placed in brackets [].
Note, the subform and contorl are both named frmqrySubmittals.
I've been at this for days. What am I doing wrong?
Thank you everyone for your help. This group has been a great resource over the past few months as I stuble through learning Access.