If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Best Way to Dynamically Alter the Select List of A Query
With respect to my earlier post, I am trying to find the best way to
dynamically alter the select list of a query. Any suggestions!! Cheers -- Regards Ashley Smart |
#2
|
|||
|
|||
Ashley
Answered in your earlier post. Another (BUT MUCH CLUNKIER) approach would be to build as many different queries as you would need for any/all combinations of choices on your form. Then, in code behind your form, values in fields would be tested to determine which query to run. CLUNKY! INELLEGANT! Regards Jeff Boyce Access MVP "A. Smart" wrote in message ... With respect to my earlier post, I am trying to find the best way to dynamically alter the select list of a query. Any suggestions!! Cheers -- Regards Ashley Smart |
#3
|
|||
|
|||
I do this all the time in code simply by altering the SQL of the querydef,
like this... Function ModifyQuery(sQueryName As String, sSql As String) As Boolean On Error GoTo Err_ModifyQuery Dim dbModify As DAO.Database Dim qdfModify As DAO.QueryDef Set dbModify = CurrentDb Set qdfModify = dbModify.QueryDefs(sQueryName) qdfModify.sql = sSql ModifyQuery = True Set qdfModify = Nothing Set dbModify = Nothing Exit Function Err_ModifyQuery: ModifyQuery = False Err.Raise Err.Number, Err.Source, Err.Description End Function -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200509/1 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem Using "Multi Select" Feature with a List Box on a Form | [email protected] | General Discussion | 3 | June 21st, 2005 05:24 PM |
Add contacts to "Select Names" list | Old Shrimp | General Discussion | 1 | April 30th, 2005 01:29 AM |
Top 20 and bottom 20 values | Brian Camire | Running & Setting Up Queries | 9 | January 8th, 2005 01:36 AM |
Multi Select List to a Report Dev Ashish | Cyndi | General Discussion | 3 | September 6th, 2004 08:52 AM |
Excel Worksheets | Richard | General Discussion | 2 | July 8th, 2004 04:34 AM |