I have continuous form with records, I want to filter.
Continuous form (Articleform) datasource is query. I am using query filter as we use it for list boxes using following criteria.
And form has unbound text field being used for text to filter, as you type.
This criteria works perfectly fine when I type any text directly on this form. (offcourse with extra piece of code for search field, given below)
Problem:
This continuous form (ArticleForm) is linked to a "Mainform" which is dashboard which is naviation form with navigation buttons.
How to path above query criteria, I tried several ways including "Mainform" name inside or navigation button name inside as well but it keeps popping up dialogue box.
My tries
etc ways, but did not work.
for reference (if some one needs to know):
form top
text search field on change
on key press
Continuous form (Articleform) datasource is query. I am using query filter as we use it for list boxes using following criteria.
Code:
Like "*" & [forms]![ArticleForm]![txtSearch] & "*"
This criteria works perfectly fine when I type any text directly on this form. (offcourse with extra piece of code for search field, given below)
Problem:
This continuous form (ArticleForm) is linked to a "Mainform" which is dashboard which is naviation form with navigation buttons.
How to path above query criteria, I tried several ways including "Mainform" name inside or navigation button name inside as well but it keeps popping up dialogue box.
My tries
Code:
Like "*" & [forms]![ArticleForm]![Mainform]![txtSearch] & "*"
Code:
Like "*" & [forms]![ArticleForm]![Navigationbutton154]![txtSearch] & "*"
for reference (if some one needs to know):
form top
Code:
Option Compare Database
Option Explicit
Private blnSpace As Boolean
Code:
Private Sub txtSearch_Change()
If blnSpace = False Then
Me.Requery
Refresh
txtSearch.SetFocus
txtSearch.SelStart = Len(Me.txtSearch.Text)
End If
End Sub
Code:
Private Sub txtSearch_KeyPress(KeyAscii As Integer)
If KeyAscii = 32 Then
blnSpace = True
Else
blnSpace = False
End If
End Sub
Last edited: