how to populate textbox based on combobox in word from excel

I

Ivan_Georgiev

Hi

I want to populate textbox (activex) in word based on combobox(activex
selection - filled from excel. I have a column named Koda2 in excel fil
named "popravila" in worksheet basisdaten, and a want when i choose
value in combobox to fill a textbox with the value from the sam
worksheet in column "nanosi"
ex
koda2 nanos

12312 45
78429 94
..
When I choose 12312 in combobox i want to fill automatically textbo
with value 45m

I fill combobox with that code

Public Sub UserForm_Initialize(

Dim db As DAO.Databas
Dim rs As DAO.Recordse
Dim rs1 As DAO.Recordse
Dim NoOfRecords As Lon

Set db = OpenDatabase("C:\Users\Ivan_Andriana\Documents\Iskr
ISD\popravila\popravila.xls", False, False, "Excel 8.0;"
Set rs = db.OpenRecordset("SELECT * FROM Koda2"
With r
.MoveLas
NoOfRecords = .RecordCoun
.MoveFirs
End Wit

ComboBox1.ColumnCount = rs.Fields.Coun

ComboBox1.Column = rs.GetRows(NoOfRecords

rs.Clos
db.Clos
Set rs = Nothin
Set db = Nothin
End Su

Thanks for help :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top