MultiPage UserForm - Need to Prevent Duplicate TextBox Entries

J

J

I need suggestions. I have a multipage userform. On the last page of the
form, there are several textboxes (more than 25). The contents of these
textboxes are page numbers for a presentation. What is the best way to
prevent duplicates from being entered?

I thought at first that I could cycle through all of the controls on the
page, then check to see if the control was a textbox, then compare that
value to the current textbox value. A few problems are apparent with that
thought - first, control.value is not available in VBA. Second, I would
have to write code for each textbox afterupdate event.

I need help figuring something out. Any ideas out there?
 
B

Bill Renaud

Instead of text boxes, would it be possible to have 2 list boxes, one on
the left and one on the right? The one on the left would list all
available (or valid) page numbers, and the one on the right would list
selected page numbers. In between both list boxes, put 2 buttons, one to
"Add" a selected item in the left list box to the right list box, and
one to "Remove" a selected item from the right list box. Also, you could
have 2 more buttons to the right of the right list box to "Move Up" and
"Move Down" a selected item in the right list box (i.e. so the right
list box could contain a list of page numbers out of order like 3, 7, 5,
8, etc.).
 

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