How should I modify the code to refer to the subform.
Private Sub Command24_Click()
Dim strWhert As String
Dim lngLeng As Long
MsgBox Forms!test2!Child16.Form.testNUm, vbInformation, "wtf"
If Not IsNull(Me.Text20) Then
strWhert = strWhert & "( Forms!test2!Child16.Form.[testNUm] >= " & Me.Text20 & ") AND "
End If
If Not IsNull(Me.Text22) Then
strWhert = strWhert & "( Forms!test2!Child16.Form.[testNUm] < " & Me.Text22 & ") AND "
End If
lngLeng = Len(strWhert) - 5
If lngLeng <= 0 Then
MsgBox "no criteria", vbInformation, "Nothing to do"
Else
strWhert = Left$(strWhert, lngLeng)
Forms!test2!Child16.Form.Filter = strWhert
Forms!test2!Child16.Form.FilterOn = True
End If
End Sub
I found that code.Its ok