![]() |
|
#1
|
||||
|
||||
![]()
Presumably you have other controls on the form such as the control button that cause the error. You could use an alternative approach e.g.
Code:
Private Sub cmdClear_Click() Dim cControl As Control For Each cControl In Me.Controls Select Case TypeName(cControl) Case Is = "TextBox", "ComboBox" cControl = vbNullString Case Else End Select Next End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#2
|
|||
|
|||
![]()
Thanks gmayor, your code works great. Is interesting how easy it is for one to get caught up in the complexity of the code that we miss the simple things. Thanks again, I really appreciate it.
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
sfitzsimmons | Word VBA | 1 | 01-11-2019 02:03 PM |
![]() |
BruceM | Word | 5 | 10-06-2016 08:26 AM |
Form with content controls - expands but at the bottom of the form | louiseword | Word | 3 | 05-27-2016 12:47 AM |
![]() |
john s. | Word VBA | 1 | 02-21-2014 02:14 PM |
Calculations using values from date picker controls | Inkarnate | Word | 0 | 06-09-2010 07:16 AM |