By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 2,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

Subform won't show data selected from Combo Box

P: n/a
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?
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Try this!

Private Sub Combo6_AfterUpdate()
dbo_REQ_subform.Form.SetFocus
dbo_REQ_subform.Form.Requery
End Sub

Filip
"Donna Sabol" <ds********@yahoo.com> wrote in message
news:e8**************************@posting.google.c om...
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?

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.