There is a less elegant (but more effective) method
Create a query
Ensure that the bound field from your 1st combo is in the query
Set the criteria as Forms![FormName]![1stComboName]
Create the datasheet from the query
Works every times (don't forget to requiery AfterUpdate of 1st combo)

Signature
Wayne
Manchester, England.
> From a previous effort using Cascading List Boxes, i was able to
> subsequently run a command button for the first listbox which then lists the
[quoted text clipped - 63 lines]
>
> End Sub
Ghagg - 26 May 2008 21:40 GMT
Thank you Wayne-I-M
No doubt you know what's best, Help. This code below is what i've been
trying, but this gives me every record in the table and not limited by the
the combo Box selection.
Private Sub cmdClassName1_Click()
Dim strForm As Form
Dim strWhere As String
With Me.cboClassName1
If Not IsNull(cboClassName1.Value) Then
strWhere = Forms![frmGHCascadingCBO]![cboClassName1] = " &
cboClassName1.Value"
End If
Me.cboClassName1.Requery
DoCmd.OpenQuery "qrycboClassName1"
End With
End Sub
> There is a less elegant (but more effective) method
>
[quoted text clipped - 76 lines]
>>
>> End Sub
Ghagg - 26 May 2008 22:30 GMT
Wayne-I-M
I think what i'm lacking in this procedure is a way to pass a variable from
the combo box selection to the query. Could that be correct??
Thanks in advance
Best regards,
Ghagg
> There is a less elegant (but more effective) method
>
[quoted text clipped - 76 lines]
>>
>> End Sub
Ghagg - 27 May 2008 00:01 GMT
I'm trying to pass the variable from the combo box to the query, however,
the code stops while passing variable.
If you know of any examples that you might recommend for me, i'm somewhat
new with access.
Thanks for your help
Ghagg
> There is a less elegant (but more effective) method
>
[quoted text clipped - 76 lines]
>>
>> End Sub
Wayne-I-M - 27 May 2008 09:32 GMT
If I understand correctly what you're trying to do, you have a combo on a
main form and you are wanting to use this to set the filter of the linked
records on a subform set to datasheet.
If this is correct then just base the datasheet on a querry that is filter
from the combo - requery OnChange of the combo
If this is not what you're trying to do then post back.

Signature
Wayne
Manchester, England.
> I'm trying to pass the variable from the combo box to the query, however,
> the code stops while passing variable.
[quoted text clipped - 86 lines]
> >>
> >> End Sub
Ghagg - 27 May 2008 13:26 GMT
Thank you Wayne-I-M for responding
OK, Consider this, i have a table with over 100K records, about 50 fields.
The class field has 210 items that repeat through out the records in this
table. I want to chose this class field as an example, then select one item
in the drop-down combo box, and filter all records based on the combo box
selection. I also have 3 cascading combo boxes.
I hope the combo box works like the list box, As i previously mentioned, i
have been able to get the 3 cascading list boxes to work with 3 different
queries. The Second list box query selects from the first list box query...
I think the problem i'm having is passing the value from the combo box
selection to the query.
Thanks for your help
Best regards,
Glenn (ghagg)
> If I understand correctly what you're trying to do, you have a combo on a
> main form and you are wanting to use this to set the filter of the linked
[quoted text clipped - 97 lines]
>> >>
>> >> End Sub
Ron2006 - 27 May 2008 17:11 GMT
In general I think you are doing the proper things.
The only word of warning is that what the combobox/listbox displays is
not necessarily what it is bound to and that has a consequence on what
you are trying to match against in the query.
If the bound column for a combo is (for instance) the ID but it is
showing something else, then the data in the table/query that is being
used for the cascading combo needs to be the ID also. This will bite
you if you are not careful, especially if you use the automatic
combobox generation which always wants to include the ID and not show
it and bind the combo to that ID.
Ron