#1
|
|||
|
|||
how to populate textbox based on combobox selection in word
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 file named "popravila" in worksheet basisdaten, and a want when i choose a value in combobox to fill a textbox with the value from the same worksheet in column "nanosi". ex. koda2 nanosi 12312 45m 78429 94m ... When I choose 12312 in combobox i want to fill automatically textbox with value 45m. I fill combobox with that code: Public Sub UserForm_Initialize() Dim db As DAO.Database Dim rs As DAO.Recordset Dim rs1 As DAO.Recordset Dim NoOfRecords As Long Set db = OpenDatabase("C:\Users\Ivan_Andriana\Documents\Isk ra ISD\popravila\popravila.xls", False, False, "Excel 8.0;") Set rs = db.OpenRecordset("SELECT * FROM Koda2") With rs .MoveLast NoOfRecords = .RecordCount .MoveFirst End With ComboBox1.ColumnCount = rs.Fields.Count ComboBox1.Column = rs.GetRows(NoOfRecords) rs.Close db.Close Set rs = Nothing Set db = Nothing End Sub Thanks for help |
#2
|
||||
|
||||
Duplicate thread (see https://www.msofficeforums.com/word-...tion-word.html). Closed.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Selection of all Text for a specific page in word is spanning selection across pages | ramsgarla | Word VBA | 9 | 12-05-2012 03:23 AM |
Display result in textbox based on the input of another textbox | scarymovie | Word VBA | 5 | 05-16-2012 07:05 PM |
Macro to populate a text form field based on dropdown selection | koloa | Word | 0 | 10-20-2011 11:52 AM |
Textbox updating from combobox selection | paxile2k | Word VBA | 0 | 10-26-2010 02:30 PM |
Populate text box based off another text box. | Perd | PowerPoint | 0 | 07-23-2010 12:50 PM |