UserForm: force to update controlsources

G

Gabor

G'Day,

On my userform I have got a multipage with dozens of textboxes and
spinbutton, which is not located on the multipage, but on the main area of
the UserForm..
If the user enters text into a textbox on the multipage and hits the
spinbutton the entry is gone lost (the ControlSouce cell is not going to be
updated).
This does not happen if the TextBox is "on the same page" with the
spinbutton.

This is a kind of a "failure-mode" I'd like to control, caused by the user
not necessarily knowing the need to enter the data before spinning onto the
next record.

How can I force update of the ControlSources of TextBoxes located on the
Multipage, on the event the SpinButton is hit ?

Private Sub SpinButton1_SpinDown()
If ScrollBar1.Value = ScrollBar1.Max Then GoTo 77
ActiveCell.Offset(1, 0).Select
ScrollBar1.Value = ScrollBar1.Value + 1
FillForm
77 End Sub

Sub FillForm()
MyLine = ActiveCell.Row
TextBox1.ControlSource = "Q" & MyLine
TextBox2.ControlSource = "R" & MyLine
TextBox3.ControlSource = "S" & MyLine
TextBox4.ControlSource = "T" & MyLine
TextBox5.ControlSource = "U" & MyLine
End Sub

Thanks
Gabor
Thans
 

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