Share via

Macro missing "Controls" from the drop down list

David Stevens 1 Reputation point
2022-10-14T15:13:52.35+00:00

I created a userform with AddData, Reset, Delete, and Exit buttons. All buttons work except the Reset Button. There is not a drop down properties for Controls. It only shows ControlSource and ControlTipText. How do I add it to be selected. Office 365, Excel.
Private Sub cmdReset_Click()
Dim txt, del

For Each txt In Frame2.Controls
If TypeOf txt Is MSForms.TextBox Then
txt.Text = ""
End If
Next txt

For Each del In Frame3.Controls
If TypeOf del Is MSForms.TextBox Then
del.Text = ""
End If
Next del

TxtDate.Text = Date
cboDepartment.Text = ""
cboPaymentMethod.Text = ""

End Sub

Developer technologies | Visual Basic for Applications

1 answer

Sort by: Most helpful
  1. Oskar Shon 49,331 Reputation points Volunteer Moderator
    2022-11-08T19:47:35.57+00:00

    I do not know why you use Textbox in frame to run code from textbox?
    I can imagine to read all data from many textboxes or some of them, but run code from it as what as event?
    I can imagine listbox with macros name to run, or ... but not that what I understand from your describe.

    Can you visualize it?

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.