2 steps " search" text control

F

Frank Situmorang

Hello,

I have the form of decision of Minutes of Meeting of our church board, the
field here is Meeting date
In the middle of this form I have the subform of MOM ( Minutes of Meeting)
which is linked to the Meeting date Form by Meeting Date ID. In the sub form
I have the field of Decesion NO ( No_Kep) and the “ Subject†and the
Decision. Subform format view is continues form…in order to accommodate so
many decision for one Meeting date.

I just created the search text control, but since it is the form using Main
and subforms, so I have 2 search_ text control, one in the main form and one
in the subform.

My search tools already work using the following VBA, but my question is:

1. Is it possible to make only one search_ text control box even though
using Main and subform?
2. OK if it is hard, I am ok with it, but how can we make it that IT
HIGHLIGHTS, the words being serached when it already found.

The following are my VBA for 2 text boxes:
In the subformL
This is my VBA of Searching:
Private Sub TxtCari2_AfterUpdate()
'Dim strFilter As String
'Dim strSQL As String
Dim strFilter As String
'strSQL = "Select MOM.No_KEP, MOM.Subject, " _
'& "MOM.Nota From KepMajelisQry Where " & "MOM.Nota LIKE """ & "*" &
Me.Txtcari & "*" & """"

strFilter = "([Nota] LIKE """ & "*" & Me.TxtCari2 & "*" & """)"
'CurrentDb.Execute strSQL, dbFailOnError
'strSQL = strfilter
'Me.FilterOn = True
Me.Filter = strFilter
Me.FilterOn = True
End Sub


IN THE MAIN FORM:

Private Sub Txtcari_AfterUpdate()
'Dim strFilter As String
'Dim strSQL As String
Dim strFilter As String
'strSQL = "Select MOM.No_KEP, MOM.Subject, " _
'& "MOM.Nota From KepMajelisQry Where " & "MOM.Nota LIKE """ & "*" &
Me.Txtcari & "*" & """"

strFilter = "([Nota] LIKE """ & "*" & Me.Txtcari & "*" & """)"
'CurrentDb.Execute strSQL, dbFailOnError
'strSQL = strfilter
'Me.FilterOn = True
Me.Filter = strFilter
Me.FilterOn = True
End Sub


Thanks for any help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top