Hello. I have a form that is used to enter data. I would also like to use this form to enable the user to dynamically query the data.
For example, if the user wanted to find every customer in New Orleans, the user would click the "clear" button, and the form would clear, and then in the City Text Field the would enter "New Orleans" and then click the "find" button.
I have found the coding necessary to clear the form, but when the form is cleared, it is actually deleting that row of data from the tables.
Below is the code that I am currently using:
For example, if the user wanted to find every customer in New Orleans, the user would click the "clear" button, and the form would clear, and then in the City Text Field the would enter "New Orleans" and then click the "find" button.
I have found the coding necessary to clear the form, but when the form is cleared, it is actually deleting that row of data from the tables.
Below is the code that I am currently using:
Code:
Private Sub cmdClear_Click()
Dim I As Integer
' Cycle through the form's controls, testing for text,
' and clear each field.
For I = 0 To Me.Count - 1
If TypeOf Me(I) Is TextBox Then
Me(I) = " "
ElseIf TypeOf Me(I) Is ComboBox Then
Me(I) = " "
End If
Next
End Sub