A Akai90 Member Local time Tomorrow, 02:32 Joined Feb 8, 2022 Messages 67 Feb 15, 2022 #1 I am trying to make a textbox get data from selected listbox from query. listbox bound with 4 column & 4 textbox when selected listbox data it will update the textbox data hope you understand
I am trying to make a textbox get data from selected listbox from query. listbox bound with 4 column & 4 textbox when selected listbox data it will update the textbox data hope you understand
June7 AWF VIP Local time Today, 10:32 Joined Mar 9, 2014 Messages 6,114 Feb 15, 2022 #2 Expression in textbox can reference combobox or listbox column by index. Index begins with 0. If value is in 2nd column its index is 1. =[comboboxname].Column(1) This will also work for a single-select listbox. If listbox is multi-select, VBA is required. This will not save to table field. Saving will require code (macro or VBA). Saving this duplicates data between tables and usually is not appropriate. Last edited: Feb 15, 2022
Expression in textbox can reference combobox or listbox column by index. Index begins with 0. If value is in 2nd column its index is 1. =[comboboxname].Column(1) This will also work for a single-select listbox. If listbox is multi-select, VBA is required. This will not save to table field. Saving will require code (macro or VBA). Saving this duplicates data between tables and usually is not appropriate.
arnelgp ..forever waiting... waiting for jellybean! Local time Tomorrow, 02:32 Joined May 7, 2009 Messages 20,566 Feb 15, 2022 #3 Code: Dim var As Variant Dim content As String For Each var In Me!Listbox1.ItemsSelected content = content & "," & Me!listbox1(var, 0) Next If Len(content) <> 0 Then Me!textbox1 = content End If
Code: Dim var As Variant Dim content As String For Each var In Me!Listbox1.ItemsSelected content = content & "," & Me!listbox1(var, 0) Next If Len(content) <> 0 Then Me!textbox1 = content End If