View Single Post
 
Old 03-19-2019, 06:58 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You can't dynamically convert a string to a variable.

Let's look at the underlying reason for attempting this code. Is it intended to augment or supercede the code in your other thread? If you want to run this as a test for changes, I would be comparing a before/after value for each of the text controls. How is the userform pre-populating the controls in order to determine whether a change has occurred? You could store initial values in hidden text boxes and do a comparison of initial to current
For example some aircode:
Code:
Sub UserForm_Initialize()
  Me.TextBox1 = "Initial value"
  Me.PreTextBox1 = "Initial value"  'each visible TextBox has a hidden partner prefilled with same initial content
End Sub
Sub UserForm_Validate()
  If Me.TextBox1 <> Me.PreTextBox1 then
    MsgBox "A change was detected"
  end if
End Sub
Handy Hint: Stick the number at the end of the control names so the vba strings are simpler to code
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote