Hello, I'm trying to populate a combobox with data from a SQL table. I have posted in the VBA forum but think I should post here as well as this may be a great plains issue.
The Great Plains VBA combobox appears to not have the additem or rowsource methods. How do you populate a combobox in VBA 6.3?
Here is my code:
Dim conn As ADODB.Connection
Dim connString As String
conString = "Provider=sqloledb;Data Source=localhost;Initial Catalog=BBTN;User Id=scott;Password=bigdaddy"
Set conn = New ADODB.Connection
conn.ConnectionString = connString
conn.Open connString
Dim rs As ADODB.RecordSet
Dim sSQL As String
Set rs = New ADODB.RecordSet
sSQL = "select RMDNUMWK from SV00564 order by RMDNUMWK"
rs.Open sSQL, conn
Do Until rs.EOF
invBegNum.additem rs.Fields.Item("RMDNUMWK").Value
rs.MoveNext
Loop
rs.Close
conn.Close
Set conn = Nothing
Set rs = Nothing
The Great Plains VBA combobox appears to not have the additem or rowsource methods. How do you populate a combobox in VBA 6.3?
Here is my code:
Dim conn As ADODB.Connection
Dim connString As String
conString = "Provider=sqloledb;Data Source=localhost;Initial Catalog=BBTN;User Id=scott;Password=bigdaddy"
Set conn = New ADODB.Connection
conn.ConnectionString = connString
conn.Open connString
Dim rs As ADODB.RecordSet
Dim sSQL As String
Set rs = New ADODB.RecordSet
sSQL = "select RMDNUMWK from SV00564 order by RMDNUMWK"
rs.Open sSQL, conn
Do Until rs.EOF
invBegNum.additem rs.Fields.Item("RMDNUMWK").Value
rs.MoveNext
Loop
rs.Close
conn.Close
Set conn = Nothing
Set rs = Nothing