[AccessD] Changing Combo Box Data Source

John W. Colby jwcolby at colbyconsulting.com
Fri Jul 15 13:34:02 CDT 2005


My solution is designed to display ALL records from the table filling the
combo when the combo does NOT have the focus.  This allows the combo to
display any of it's valid values when the form is just being browsed.  If
the combo is going to be used to SELECT filtered records from the table
filling the combo, then the query is changed as the user clicks into the
combo.  The user can now ONLY SELECT filtered records from the combo's
table.

It sounds like that is what she wanted.  If you filter the combo to only
display open projects, but the form displays ALL projects, then as the user
browses the records, the records with CLOSED projects will display a blank
in the combo.  The combo MUST DISPLAY ALL possible choices when JUST
BROWSING, but filter down to only allow OPEN projects when adding new
records.

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mike & Doris
Manning
Sent: Friday, July 15, 2005 2:13 PM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Changing Combo Box Data Source


How is that the "correct" way?  The OnEnter event occurs when the control
receives focus and the OnExit event occurs when the control loses focus.

You suggested solution would have records always UNFILTERED with no way to
FILTER them because as soon as the user leaves the combo to do something to
a filtered record, the records would unfilter again.

Doris Manning
Database Administrator
Hargrove Inc.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John W. Colby
Sent: Friday, July 15, 2005 1:45 PM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Changing Combo Box Data Source

The "correct" way to handle this is to have a query that shows ALL records
(UNFILTERED) and another that shows FILTERED records.  In OnEnter, change
the query to the FILTERED query, in OnExit change the query to the
UNFILTERED query.

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Nicholson, Karen
Sent: Friday, July 15, 2005 1:32 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Changing Combo Box Data Source


I know there is a way to do this.  Where are the Friday Jokes?  My form
opens.  The combo box on the form is filtering for only "Open" items.
However, PIA user wants the option to see all projects, open and closed.
What code do I throw on a button to change the record source of the combo
box to take off the filter?  Is it setting the recordset?  Thanks.
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com






More information about the AccessD mailing list