Copy selected list box value and paste it to a txtbox

S

shiro

Hi all,
I have 1 listbox,1cmdButton and 1 txtBox in my form.
I want every time the user click the cmdButton,the selected
listbox value is added to the txtBox,if the user click it
more than once,the value in the txtBox separated by * ; *.
How to do that?

Thank's

Shiro
 
G

gllincoln

Hi Shiro,

Put your code in the onClick event of the command button.

If Len(Nz(Me!txtBox.Value)) > 0 Then
Me!txtBox.Value = Me!txtBox.Value & "* ; *" & Me!ListBox.Value
Else
Me!txtBox.Value = Me!ListBox.Value
End If

Hope this helps...
Gordon
 

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