Posted By

heislekw on 10/21/08


Tagged

controls null ctl


Versions (?)

Set all controls on a form to null


 / Published in: Visual Basic
 

  1. Private Sub cmdClear_Click()
  2. On Error GoTo Err_cmdClear
  3.  
  4. Dim Ctl As Control
  5. On Error Resume Next
  6. For Each Ctl In Me.Controls
  7. Ctl.Value = Null
  8. Next Ctl
  9.  
  10. Exit_cmdClear:
  11. Exit Sub
  12.  
  13. Err_cmdClear:
  14. MsgBox Err.Description
  15. Resume Exit_cmdClear
  16.  
  17. End Sub

Report this snippet  

You need to login to post a comment.