Created
May 24, 2016 11:30
-
-
Save Phuseos/823b00d14ad0b185bbedb5175031c73c to your computer and use it in GitHub Desktop.
Clear control values on current active form (VBA)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Option Compare Database | |
| Function CleanForm() | |
| 'Call as CleanForm(), will clear current text & comboboxes on active form. | |
| For Each ctl In Form.Controls 'Loop through controls of the form | |
| Select Case ctl.ControlType | |
| Case acTextBox, acComboBox 'Select Textboxes and Comboboxes (DropDownLists) | |
| ctl.value = "" 'Set the value to "" | |
| End Select | |
| Next | |
| End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment