B
Bob
How do I go about assigning a button to clear the 4 other text boxes on that
form?
Thanks in advance.........Bob Vance
form?
Thanks in advance.........Bob Vance
Not forgetting "Dim ctl as Control" ;-)Nikos Yannacopoulos said:Bob,
The code behind the button should be:
For each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
Me.Controls(ctl.Name) = Null
End If
Next
Nikos Yannacopoulos said:Not necessary if not Option Explicit.
Open your form in design view and double-click your command button. ThisBob said:Sorry can you tell me how to put a code behind a button, I am a Newbie,
Thanks Bob
If you have "Option Explicit" at the very top of the code then you need thisBob said:I did that and now I am getting a yellow line on this part of the code
Me.Controls(ctl.Name) = Null
Thanks Bob
Bob said:Still getting a yellow line through Me.Controls...
Private Sub Command40_Click()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
Me.Controls(ctl.Name) = Null
End If
Next
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.