Cascading Combo Box
Hello,
I'm trying to create a Cascading Combo Box similar to the one in CH13 pg.473-474, but when I try to run it, it gives me an error highlighting the Me!cboCounty in the ReplaceWhereClause.
The error shown is the "Compile error: Sub or Funcion not defined".
I'm not sure what is causing this error, but I do not understand what is the CountyCode referencing to.
Below is the complete code:
Option Compare Database
Option Explicit
Private Sub cboCounty_AfterUpdate()
Me!cboCity = Null
If IsNull(cboCounty) Then
Me!cboCity.Enabled = False
Else
Me!cboCity.Enabled = True
Me!cboCity.RowSource = ReplaceWhereClause(Me!cboCity.RowSource, _
"Where [tblCity].[CountyKey] = " & Me!cboCounty)
Me!cboCity.Requery
End If
End Sub
|