Re: Cascading combo box confusion



Record lookups must always be based on unbound list or combo boxes. By
unbound, I mean to the form's recordsource. They must still be bound to a
sql statement, table, or query as a row source.

You can bind a succession of combo or list boxes to the recordsource like
you have appeared to do for creating records. You may need to requery the
rowsource if it doesn't change with your code. Try adding:

Me.cbxMake.Requery

to the end of your code as shown.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"meznak" <nplamondon@xxxxxxxxx> wrote in message
news:1181687546.448676.48830@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have three combo boxes on a form displaying Type, Make, and Model of
machine in the selected record. I only have Model stored in the
record (in tblServers) and the form should pull Type and Make from
another table (tblModel). I am able to get that working by setting
"Control Source = Model" for cbxType and cbxMake. That works for
displaying existing records, but not well for entering new records.

When creating a new record, I want to be able to select Type,
filtering cboMake; select Make, filtering cboModel. I am able to get
this working with the following code:

Private Sub cbxType_AfterUpdate()
Dim strSQL As String
'This function sets the RowSource of cbxMake, based on the
'value selected in cbxType.
sSQL = "SELECT DISTINCT Make " _
& " FROM tblModel WHERE Type = '" & Me.cbxType _
& "' ORDER BY Make"
Me!cbxMake.RowSourceType = "Table/Query"
Me!cbxMake.RowSource = sSQL

(repeated/tweaked for cbxMake)

That function only works when I unbind the combos. I would very much
like to have both functions work on the same form. Does anyone have
suggestions on how to do this?



.