Hi there
I have a form with bunch of TxtBoxes, comboBoxes, Buttons, and a subform, I would like to set the value of all the TxtBoxes and comboBoxes in my Form (Not the subform) to Null.
I know one way to do it is by calling each one of them like;
Me.InvoiceID100.Value = Null
But since there are too many of them, I would like to use some thing like this;
Private Sub Command8_Click()
Dim i As Integer
For i = 0 To Me.Controls.Count - 1
Me.Controls(i).value = null
Next i
End Sub
But it is not working, could you tell me why?
Also If I want to exclude a Control by name of “salesID”, How can I do it?
Best regards
Sanan
I have a form with bunch of TxtBoxes, comboBoxes, Buttons, and a subform, I would like to set the value of all the TxtBoxes and comboBoxes in my Form (Not the subform) to Null.
I know one way to do it is by calling each one of them like;
Me.InvoiceID100.Value = Null
But since there are too many of them, I would like to use some thing like this;
Private Sub Command8_Click()
Dim i As Integer
For i = 0 To Me.Controls.Count - 1
Me.Controls(i).value = null
Next i
End Sub
But it is not working, could you tell me why?
Also If I want to exclude a Control by name of “salesID”, How can I do it?
Best regards
Sanan