Hi, I'm using the DAO360.dll and trying to connect the DataCombo with the recordset. When a run the project I receive an error in the line: Set DataCombo1.RowSource = rs "Wrong number of arguments or invalid property assingnmet" Any ideas? Thanks Public dbInfo As Database Public rsInfo As Recordset Private Sub UserForm_Initialize() Dim sql As String Dim rs As Recordset Set dbInfo = OpenDatabase("MSA.mdb") sql = "SELECT * FROM INSUMO" Set rs = dbInfpenRecordset(sql, dbOpenDynamic) Set DataCombo1.RowSource = rs '<--- ERROR DataCombo1.ListField = "DS_INSUMO" DataCombo1.Refresh End Sub
Usually when this kind of error appears, the first thing to do is to try it without the 'Set' keyword DataCombo1.RowSource = rs
The RowSource property is expecting a string not an object reference [which is what your rs variable would hold]. Set is used to assign an object reference to a variable or property of compatiable data type. Also, I believe the RowSource property wants a range of cells from an Excel worksheet and not an Access database. Type "RowSource in the Immediate window of the AutoCAD VBAIDE and press F1 for further explanation. HTH. Joe
OOPS! sorry bad info. I am trying to remember the solution to your problem. I had the same problem back about 4 years on one of my projects. If I can find it or remember how to get around the problem I'll get back to you.
Thanks, I'll wait for your response... problem. I had the same problem back about 4 years on one of my projects. to you.