H
Hiro
Hello Forum Members:
I have setup the following using Access 2000:
1) cmdFilter button on the Form Header on the Main Form
2) cmdReset button on the Form Header on the Main Form
3) Sub Form inside the Main Form
cmdReset button is working as far as I am on the Main Form to just reset
(clear) the words that I typed on the unbound text box.
What I want to accomplish is that on the filtered Sub Form, when I hit the
cmdReset button, I want the screen to go back to the original non-filtered
Main Form.
The code below just resets (clears) the words on the unbound text box and it
does not allow me to go back to the original non-filtered screen.
Would you help me accomplish this taks?
{code}
Private Sub cmdFilter_Click()
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.FindWord) Then
strWhere = strWhere & "([English] Like ""*" & Me.FindWord & "*"")
AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "Nothing is specified.", vbInformation, "Nothing to show."
Else
strWhere = Left$(strWhere, lngLen)
Me.Child19.Form.Filter = "[English] Like '*" & Me.FindWord & "*'"
Me.Child19.Form.FilterOn = True
End If
End Sub
{/code}
{code}
Private Sub cmdReset_Click()
Dim ctl As Control
For Each ctl In Me.Section(acHeader).Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox
ctl.Value = Null
End Select
Next
Me.FilterOn = False
End Sub
{/code}
With best regards,
Hiro
I have setup the following using Access 2000:
1) cmdFilter button on the Form Header on the Main Form
2) cmdReset button on the Form Header on the Main Form
3) Sub Form inside the Main Form
cmdReset button is working as far as I am on the Main Form to just reset
(clear) the words that I typed on the unbound text box.
What I want to accomplish is that on the filtered Sub Form, when I hit the
cmdReset button, I want the screen to go back to the original non-filtered
Main Form.
The code below just resets (clears) the words on the unbound text box and it
does not allow me to go back to the original non-filtered screen.
Would you help me accomplish this taks?
{code}
Private Sub cmdFilter_Click()
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.FindWord) Then
strWhere = strWhere & "([English] Like ""*" & Me.FindWord & "*"")
AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "Nothing is specified.", vbInformation, "Nothing to show."
Else
strWhere = Left$(strWhere, lngLen)
Me.Child19.Form.Filter = "[English] Like '*" & Me.FindWord & "*'"
Me.Child19.Form.FilterOn = True
End If
End Sub
{/code}
{code}
Private Sub cmdReset_Click()
Dim ctl As Control
For Each ctl In Me.Section(acHeader).Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox
ctl.Value = Null
End Select
Next
Me.FilterOn = False
End Sub
{/code}
With best regards,
Hiro