Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combobox additem method

Status
Not open for further replies.

gogetsome

Technical User
May 27, 2004
21
US
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

 
Simple answer... you can't.

There is no method available to be able to add items to a combo or list box.

I tried a hack method of using pass though Dexterity scripts from VBA, but Dexterity cannot see a field added by the modifier, so that does not work either.

David Musgrave [MSFT]
Senior Development Consultant
Escalation Engineer
MBS Support - Asia Pacific

Microsoft Business Solutions

Any views contained within are my personal views and
not necessarily Microsoft Business Solutions policy.
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
I was affraid of that. Is it possible to have a buttons click event open a web page?
If so, what is the code in VBA

I've tried

response.redirect("hhtp://
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top