Dim oRS As New ADODB. You
OCon. Open the Provider="Microsoft. ACE. The OLEDB. 12.0;" _
& "Data Source=" & amp; CurrentProject. Path & amp; "\ Order_DataBase. Accdb;"
Me.Com boBox1. AddItem oRS. Fields
ORS. Close
OCon. Close
The Set of oRS=Nothing
The Set oCon=Nothing
Always prompt 2047 errors.
Consult the warrior.
CodePudding user response:
Add the field type correspondingThe data binding?
For your reference
CodePudding user response:
With the attention to this problemCodePudding user response:
1 oRS object to open (query recordset)2 write code to oRS AddItem line by line to a column of data in the ComboBox,
CodePudding user response:
Also note this problemCodePudding user response:
Dim oCon As New ADODB. Connection
Dim oRS As New ADODB. You
Dim As integer I
OCon. Open the Provider="Microsoft. ACE. The OLEDB. 12.0;" _
& "Data Source=" & amp; CurrentProject. Path & amp; "\ Order_DataBase. Accdb;"
If oRS. State<> Adstateclosed then oRS. Close
ORS. Open the "select aa from table name"
ComboBox1. Clear
For I=1 to oRS. Recordcount
ComboBox1. AddItem oRS! Aa & amp;" "
ORS. Movenext
Next I
ORS. Close
OCon. Close
The Set of oRS=Nothing
The Set oCon=Nothing