The bound column of cboDMCategories is the column that must appear in the
where clause of the query for cboQstPtVal.
so the query for cboQstPtVal should be more like:
SELECT tblQuestions.QstWithPtVal, tblQuestions.QstID, tblQuestions.[DM
Category] FROM tblQuestions WHERE (((tblQuestions.[DM
CatID])=forms!testsubfrmDMInspDet!cboDMCategories));
Note that I have replaced
FROM tblQuestions WHERE (((tblQuestions.[DM Category])=yadda, yadda, ...
with
FROM tblQuestions WHERE (((tblQuestions.[DM CatID])=yadda, yadda, ...
This assumes that the field called DM CatID actually has a space in its
name.
Jeanette Cunningham
ridgerunner said:
Sorry for the typo. Immediate window is 'DMCategory:1'
:
If the column numbers begin with 1, otherwise adjust for -1:
The bound column for cboDMCategories is column 1 (DMCatID)
Column 2 has DMCategories in it.
The value for DMCategory in the immediate window is 1DMCategory:1'
Thanks for your help.
:
To answer your question about the form's recordsource - using the table
is
fine.
About the combo boxes.
Which column is the bound column for cboDMCategories?
Which column has DMCategories in it?
In the after update event for cboDMCategories, put this line of code
Debug.Print "DMCategory: " & Me.cboDMCategories
Open the form and select a category.
Press Ctl + G to open the immediate window.
What is the value for DMCategory in the immediate window?
Jeanette Cunningham
If I drop down cboQstVal I do not seen any data.
3 columns are in cboDMCategories
4 columns in cboQstVal
I do not understand the question about the foreign field for the
query for
cboQstVal.
The query is the same as the SELECT statement below.
I would like to ask another question. The form originally used the
table
that the data would be entered into as the Record Source, before I
tried
using combo boxes. Would that be different now?
Thanks for your help
:
as you had it
forms!testsubfrmDMInspDet!cboDMCategories
A few questions.
How many columns in cboDmCategories?
Which column is the foreign field for the query for cboQstVal?
How many columns in cboQstVal?
If you drop down cboQstVal, can you see any data?
Jeanette Cunningham
message
What would it look like if the subform is not yet sitting inside a
main
form?
:
Hi,
there is a problem with the way you are referencing the subform.
Change
forms!testsubfrmDMInspDet!cboDMCategories
to
forms!MainFormName!NameOfSubformControl!cboDmCategories
Replace MainFormName and NameOfSubformControl with your names.
Note that the name of the subform control may be different from
the
name
of
the form that sits inside the subform control.
Jeanette Cunningham
message
Is there a common reason for a combo box not showing any
values?
Is there something wrong with the code in the RowSource, below:
cboQstPtVal
SELECT tblQuestions.QstWithPtVal, tblQuestions.QstID,
tblQuestions.[DM
Category] FROM tblQuestions WHERE (((tblQuestions.[DM
Category])=forms!testsubfrmDMInspDet!cboDMCategories));
If I add "OR 'An actual category name' " that category list
will
show
up.
cboDMCategories allows a user to pick a category and is
working. I
put
an
AfterUpdate Event in the cboDMCategories to Requery cboQstVal,
but
that
has
not helped.
Thanks very much
ridgerunner