VBA How to Reset a List box

W

wejofost

I have a user Data Entry FORM where the user must input 14 values.
Only one of the 14 values is a list box ( where the user can select one
value from the list) the other 13 being a mixture of Text and numeric
input.
If the user makes a serious mistake and wants to restart from scratch
they can use the CANCEL button to clear down all the data they have
entered and start again.
The 13 data field sare clearing down OK BUT how do I reset the list box
back to the start of the list of choices?

Grrrrrrr. Can't find this info any where!

Help please!
 
R

Rick Hansen

Hello wejofost,

try
Me.ListBox.Clear (this completely clear the listbox)

then re-initialize the listbox by using the addItem method

Rick
 
W

wejofost

Here is the Cleardata function.

I tried Me.ListBox.Clear but it doesn't crack it.

Here is the code. First line of List Box data ( Select location ) is in
A100.

Private Sub ClearData()
' Clear down all data fields before user starts input.
'
' lstTCRef.Text = Cells(a100)
txtArticle.Text = ""
txtQty.Text = ""
txtOriginalROP.Text = ""
txtOriginalTS.Text = ""
txtNewROP.Text = ""
txtNewTS.Text = ""
' Me.ListBox.Clear
' Me.lstTCRef.Clear

End Sub


Any Clues?
Thank you for your help.

Wej Parry
 

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