I have a form (frm_MAIN_RPT) that contains a combo box (Combo6) &
subform (dbo_REQ_subform). The combo box is used to select the "cost
center" data that will be displayed in the subform. From there, I
have a button that runs a report based on which item I select in the
subform.
1. The Combo Box correctly displays the list of cost centers within
the combo box.
2. The subform, when opened separately, correctly displays the data
for the cost center highlighted on the main form.
3. HOWEVER, the subform will NOT show this data, when viewed on the
main form, it stays blank.
The event for the combo box is:
Private Sub Combo6_AfterUpdate()
dbo_REQ_subform.SetFocus
dbo_REQ_subform.Requery
End Sub
I thought if I set the focus to the subform & have it requery based on
the value I selected from the combo box, it would display the data.
But it stays blank, as if there's no matching records. I can see
column headings, but no data. But remember, if I open this subform
separately, after selecting the cost center in the combo box, I see
the data that corresponds to my selection.
SQL for data in subform:
SELECT DISTINCTROW dbo_REQ.REQ_ID, dbo_REQ.REQ_NO, dbo_REQ.CC_ID,
dbo_CC.NAME, dbo_CC.ACCT_NO, dbo_REQ.STAT
FROM dbo_REQ INNER JOIN dbo_CC ON dbo_REQ.CC_ID = dbo_CC.CC_ID
WHERE (((dbo_CC.NAME)=[FORMS]![frm_MAIN_REPORT]![Combo6]) AND
((dbo_REQ.STAT)=13) AND ((dbo_CC.CORP_ID)=1290) AND
((dbo_REQ.REQ_TYPE)=1 Or (dbo_REQ.REQ_TYPE)=3));
Any ideas?