TCARPENTER
Programmer
I have a simple form with a combo box, and in the after update event I have this chunk of code:
The recordset has values, but I keep getting this error at the line above in red:
Any help would be appreciated.
Thanks
Todd
Code:
Private Sub cboTables_AfterUpdate()
Dim rs As New ADODB.Recordset
Dim cn As New ADODB.Connection
Dim strTableName As String
strTableName = Me.cboTables.Value
Set cn = CurrentProject.Connection
Set rs = cn.OpenSchema(adSchemaTables, _
Array(Empty, Empty, Empty, "Table"))
Set rs = cn.OpenSchema(adSchemaColumns, Array(Empty, Empty, strTableName, Empty))
[red]Set Me.sfmEnumFields.Form.Recordset = rs[/red]
End Sub
The recordset has values, but I keep getting this error at the line above in red:
Run-time error '7965':
The object you entered is not a valid Recordset property.
Any help would be appreciated.
Thanks
Todd