Trying to find a better way to clear textboxes

T

TN Bella

Hi,
Here is part of one sub where I want to clear all textboxes (there are
three subs where I do this, one contains more textboxes, the other is
below and the final one looks the same but omits the
txtInvLoc.SelectedItem box). Some of the examples online didn't work out
to well for me. I want a shorter way to clear the fields, but also
another option that clears all fields but one: txtInvLoc.SelectedItem.
Can someone direct me to an example or show me how I can accomplish this
task? Thanks in advance for the assistance.

Sub ClearForm (Source As Object, Args As EventArgs)

txtSupName.Text = ""
txtSupCD.Text = ""
txtSupsfx.Text = ""
txtAcctAmt.Text = ""
txtInvNum.Text = ""
txtInvDate.Text = ""
txtInvLoc.SelectedItem.Value = ""
txtInvAmt.Text = ""
txtTerms.SelectedItem.Value = ""
txtPay.SelectedItem.Value = ""
txtCurr.SelectedItem.Value = ""

End Sub
(there are actually textboxes and dropdownlists(selected.value).
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top