rutgermons
asked on
obtain value from selected listbox item
Folks
I have listbox with values, if I click on the selected value I get a message showing the depicted list box item from the list i.e. like so:
Private Sub ListBox1_Click()
MsgBox "Selected Value is " & ListBox1.Value & ""
1) how do I get the select value to display in an excek worksheet i.e. on sheet 1 field b1?
2) how do I get a listbox1.value to display and parse in SQL statement on a DB connection i.e.:
strSQL = "SELECT * FROM MYTABLE WHERE PARAMETER = ListBox1.Value ?
would be glad for your assistance
cheers
I have listbox with values, if I click on the selected value I get a message showing the depicted list box item from the list i.e. like so:
Private Sub ListBox1_Click()
MsgBox "Selected Value is " & ListBox1.Value & ""
1) how do I get the select value to display in an excek worksheet i.e. on sheet 1 field b1?
2) how do I get a listbox1.value to display and parse in SQL statement on a DB connection i.e.:
strSQL = "SELECT * FROM MYTABLE WHERE PARAMETER = ListBox1.Value ?
would be glad for your assistance
cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For dates you want to use "#" as delimiters, I think:
strSQL = "SELECT * FROM MYTABLE WHERE PARAMETER = #" & ListBox1.Value & "#"
ASKER
"Backlog 01208 - Backlog request thru 12/08/13"