Hi,

I am using the following VBA code but it is giving me a Type Mismatch error on the line marked below.

Private Sub Combo0_AfterUpdate()

Dim sql As String
Dim rst As Recordset

sql = "Select * from MailboxCats where MailboxName= '" & Me.Combo0.Value & "'"


Set rst = CurrentDb.OpenRecordset(sql) <--------- TYPE MISMATCH ERROR

'extract the sub category field

While Not rst.EOF
Combo2.AddItem rst.Fields(1) 'I am extracting the second field
rst.MoveNext
Wend

End Sub


Please help. Thanks