Rod,
I believe all you need to do is change the the Row Source property of the combo box. There is no need to change querydefs. For instance, if the first combo box selects a numeric product category ID you could add code to the after update event of the combo box like:
Dim strSQL as String
strSQL = "SELECT ProductID, ProductName " & _
"FROM Products WHERE CategoryID = " & Me.cboProdCategory & _
" ORDER BY ProductName"
Me.cboProduct.RowSource = strSQL
Duane Hookom, MVP
MS Access
----------------------------------------
> To: MS_Access_Professionals@yahoogroups.com
> From: desertscroller@cox.net
> Date: Mon, 19 Aug 2013 00:39:28 +0000
> Subject: [MS_AccessPros] ParseSQL question
>
> I have been trying to redefine the data source for a combobox based on the selection from either a checkbox or another combobox. Reading the queryDef members of the database makes a lot of sense. However, the examples I have found make a call to a subroutine which I can not seem to find. The call is to a procedure
> Call ParseSQL(strSQL, strSELECT, strWhere, strOrderBy, _
> strGROUPBY, strHAVING)
> which breaks the SQL statement down into the various segments. I know I can development something similar but thought since Microsoft was using it in there literature that it might already exist.
>
> Does anyone know if it does or should I bite the bullet? Just trying to change the WHERE clause for filtering.
>
> Rod
>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar