469,636 Members | 1,555 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,636 developers. It's quick & easy.

Subform won't show data selected from Combo Box

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
1 3155
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.

Similar topics

1 post views Thread by Alienz | last post: by
3 posts views Thread by Paul T. Rong | last post: by
18 posts views Thread by Robert Jacobs | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.