473,395 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 3439
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: CSDunn | last post by:
Hello, In Access ADP's that connect to SQL Server databases, any time I have a situation where I have a combo box in a main form that looks up a record in a subform, the subform record source has...
1
by: Alienz | last post by:
Alien hello to whoever is reading today. Ill try to explain this as simply as possible its just a weird thing thats happening here in Access 2000 subforms.. I think something small is out of...
3
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name...
4
by: Mason | last post by:
This is probably an incredibly newbie-ish question. I just haven't had the cause to use many subforms before, so I'm pretty sure I just don't understand it correctly (even after reading up on it)....
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
18
by: Robert Jacobs | last post by:
Please advise... I currently have a Mainform (Customers) and a Subform (Service Requests) with a one to many relationship (one customer, many service requests) with a CustomerID that is unique...
6
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
5
by: samdev | last post by:
I have created two combo boxes in a subform.... For example 1. Combo Box State 2. Combo Box City 3. When a state from the Combo Box State is selected, the City combo box updates to reflect...
5
by: JHite | last post by:
I’m using Access 2003 on Windows XP. I have a Mainform (Staff Entry) which displays an unbound combo box named ChooseStaff. The Row Source for this combo box is a SELECT of the UserIDs and Staffer...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.