aworthey
08-17-2016, 08:31 AM
Hello,
I'm encountering a very frustrating error with one of my userforms. I have 15 textboxes on one userform that require the user to input a special code from a custom numbering system. To assist in selecting the appropriate number code, I created another userform that launches from command buttons next to each textbox. To avoid having 15 copies of this number code finder userform, I assigned the textbox name to a hidden label caption on the number code finder userform. This label caption is assigned to a variable that I'm using to make sure that the selected number code populates the correct textbox on the previous form. In the case an appropriate number code doesn't exist yet, I have yet another form for its creation. This hidden textbox name gets passed on to the next userform, as well.
This has been working perfectly until I tried to modify the number code creation userform. When I launched the userforms, whatever modifications I made were deleted. I could not figure out why this was happening. So, I recreated the userform from scratch with all the additional fields I needed. When I launched the userform, all labels, textboxes, and comboboxes were deleted...the only thing left on the userform were the two command buttons.
Has anyone else encountered anything like this before?
Here's the code that is involved when I click debug:
Private Sub cmdNewSN_Click()
Dim boxSMART As String
boxSMART = frmSMARTNumberPicker.bxSMRTvalue.Caption
With frmSMARTNumberCreator.bxSMRTvalue
.Caption = boxSMART
End With
If frmFinishTA.cboModel.Value <> "" Then
frmSMARTNumberCreator.ComboBox4.Value = frmFinishTA.cboModel.Value
Else: frmSMARTNumberCreator.ComboBox4.Value = ""
End If
Unload frmSMARTNumberPicker
frmSMARTNumberCreator.Show
End Sub
I'm encountering a very frustrating error with one of my userforms. I have 15 textboxes on one userform that require the user to input a special code from a custom numbering system. To assist in selecting the appropriate number code, I created another userform that launches from command buttons next to each textbox. To avoid having 15 copies of this number code finder userform, I assigned the textbox name to a hidden label caption on the number code finder userform. This label caption is assigned to a variable that I'm using to make sure that the selected number code populates the correct textbox on the previous form. In the case an appropriate number code doesn't exist yet, I have yet another form for its creation. This hidden textbox name gets passed on to the next userform, as well.
This has been working perfectly until I tried to modify the number code creation userform. When I launched the userforms, whatever modifications I made were deleted. I could not figure out why this was happening. So, I recreated the userform from scratch with all the additional fields I needed. When I launched the userform, all labels, textboxes, and comboboxes were deleted...the only thing left on the userform were the two command buttons.
Has anyone else encountered anything like this before?
Here's the code that is involved when I click debug:
Private Sub cmdNewSN_Click()
Dim boxSMART As String
boxSMART = frmSMARTNumberPicker.bxSMRTvalue.Caption
With frmSMARTNumberCreator.bxSMRTvalue
.Caption = boxSMART
End With
If frmFinishTA.cboModel.Value <> "" Then
frmSMARTNumberCreator.ComboBox4.Value = frmFinishTA.cboModel.Value
Else: frmSMARTNumberCreator.ComboBox4.Value = ""
End If
Unload frmSMARTNumberPicker
frmSMARTNumberCreator.Show
End Sub