I've tried using this code
me.cbxautofctitlel.rowsource = rstEmpNames
but I get a run error saying that Jet can't find a table or query with which to populate the combobox. With ADO I have to open a connection to a remote table and then use a recordset to import the data.
What I'm doing now is using the following code to get the data out of the recordset and populate a temporary table and base my rowsource on this table. This way works but is slow and it just seems to me that there must be a way to use the rowsource and recordset directly instead of going to new york from la via china.
With rstEmp
If Not .EOF Then
strBuf = rstEmp(0).name
End If
Do While Not .EOF
If Not rstEmp(0) = "" Then
strEmpID = rstEmp(0)
Else
strEmpID = ""
End If
If Not rstEmp(1) = "" Then
strEmpLName = rstEmp(1)
strEmpLName = Replace(strEmpLName, "'", "")
'Debug.Print strEmpLName
Else
strEmpLName = ""
End If
If Not rstEmp(2) = "" Then
strEmpFName = rstEmp(2)
Else
strEmpFName = ""
End If
If Not rstEmp(3) = "" Then
strEmpTitle = rstEmp(3)
Else
strEmpTitle = ""
End If
If Not rstEmp(4) = "" Then
strEmpPh = rstEmp(4)
Else
strEmpPh = ""
End If
strInsert = "insert into tblTmpStorage values ('" & strEmpID & "','" & strEmpLName & "','" & strEmpFName & "','" & strEmpTitle & "','" & strEmpPh & "')"
DoCmd.RunSQL strInsert