1 Replies - 585 Views - Last Post: 11 July 2017 - 06:37 AM Rate Topic: -----

#1 grzeniu   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 17-September 13

Data to combobox and textbox [VB6]

Posted 10 July 2017 - 11:21 PM

Hey can you help me, I can not handle the following thing: I am writing a macro that should work as follows: The macro is connected to the database with access "database.mdb" in which there are three columns 1.Name

On the form I have placed 1 (combo1) combobox and 2 x texbox (text1.text, text2.text).

Combo1.box loads with data from the database.mdb from the first column (name), how do I make the data in textbox1 and texbox2 be loaded from the second and third column after selecting a combo1 item?

Private Sub Form_Load()

With Adodc1.Recordset
Do Until .EOF
Combo1.AddItem !Nazwa
End With

End Sub

Is This A Good Question/Topic? 0
  • +

Replies To: Data to combobox and textbox [VB6]

#2 modi123_1   User is offline

  • Suitor #2
  • member icon

Reputation: 14089
  • View blog
  • Posts: 56,440
  • Joined: 12-June 08

Re: Data to combobox and textbox [VB6]

Posted 11 July 2017 - 06:37 AM

Wouldn't a combobox have more than one value.. as in be multiple rows from a DB while the textboxes would show only one row's column's worth of data in each? You shouldn't be doing that in a single query.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1