Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / April 2008

Tip: Looking for answers? Try searching our database.

Common Cause for Combo Box Not Showing Value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ridgerunner - 17 Apr 2008 01:39 GMT
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
Jeanette Cunningham - 17 Apr 2008 02:32 GMT
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

> Is there a common reason for a combo box not showing any values?
> Is there something wrong with the code in the RowSource, below:
[quoted text clipped - 13 lines]
> Thanks very much
> ridgerunner
ridgerunner - 17 Apr 2008 02:48 GMT
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.
[quoted text clipped - 26 lines]
> > Thanks very much
> > ridgerunner
Jeanette Cunningham - 17 Apr 2008 04:04 GMT
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

> What would it look like if the subform is not yet sitting inside a main
> form?
[quoted text clipped - 32 lines]
>> > Thanks very much
>> > ridgerunner
ridgerunner - 17 Apr 2008 12:34 GMT
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
[quoted text clipped - 43 lines]
> >> > Thanks very much
> >> > ridgerunner
Jeanette Cunningham - 17 Apr 2008 22:20 GMT
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
[quoted text clipped - 61 lines]
>> >> > Thanks very much
>> >> > ridgerunner
ridgerunner - 18 Apr 2008 02:51 GMT
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.
[quoted text clipped - 76 lines]
> >> >> > Thanks very much
> >> >> > ridgerunner
ridgerunner - 18 Apr 2008 03:04 GMT
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)
[quoted text clipped - 83 lines]
> > >> >> > Thanks very much
> > >> >> > ridgerunner
Jeanette Cunningham - 18 Apr 2008 04:21 GMT
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

> Sorry for the typo.  Immediate window is 'DMCategory:1'
>
[quoted text clipped - 95 lines]
>> > >> >> > Thanks very much
>> > >> >> > ridgerunner
ridgerunner - 18 Apr 2008 14:42 GMT
Thank you SO much.  The drop down works now, but I am having another problem.
If I close the form, reopen and change a record, all the entries for
QstPtVal that have a category different from the one I am working on blank
out.  How can I fix that?

> The bound column of cboDMCategories is the column that must appear in the
> where clause of the query for cboQstPtVal.
[quoted text clipped - 114 lines]
> >> > >> >> > Thanks very much
> >> > >> >> > ridgerunner
ridgerunner - 18 Apr 2008 19:52 GMT
I moved the Requery to the OnEnter Event and that seems to work better.  If
this might create problems or I am just not doing this incorrectly, please
let me know.

> Thank you SO much.  The drop down works now, but I am having another problem.
>  If I close the form, reopen and change a record, all the entries for
[quoted text clipped - 119 lines]
> > >> > >> >> > Thanks very much
> > >> > >> >> > ridgerunner
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.