Christopher Koh wrote:
No, i am not using a subform. My form uses the return results of a
query in a tabform in the detail section. I just found out that you
can use the binoculars on the menu to find the searched word in the
tabular form then highlights it, it also has a find next.
This was my intention. But instead of using this , I want another way
thru VB editor in which the user inputs what he wants to search on the
textbox, then he clicks on the cmdgo button to look for the word in
the tabularform then highlights it, it also has a findnext
When you said "Tabular form" I thought you meant a form with tabs on them.
I have two methods I'll talk about.
I call your type of form a log form and my log forms are "continuous"
forms, not datasheet. I'm basically displaying a list of records in a
table filtered and sorted the way I want. Above each column I put a
text field in the form header. When a person enters a value in that
field above that column, I clear out any other values in the other
search fields (I use the Tag property to determine which fields to
clear). I associate each column with a field. I then create a search
string from it and store it to a public variable. When the person
presses Enter or Tab, it searches for that field. If it finds it, it
moves to that record and sets focus. If the F3 key is pressed, it
searches for the next record. It's a pretty generic form.
The second method uses a form/subform. The Main form has 2 combo
fields; a combo box and a search field. The subform is a datasheet.
When I call the form, I pass the name of the calling form. Based on the
calling form I change the recordsource of the subform. The combo box is
updated and display a list of all columns in the datasheet. The person
then selects the field to search for in the combo and enters the value
to search for. When enter or tab is pressed it searches for the record
for a matching value for the column field selected in the combo. If
found, it moves to that record.
I set the dbl-Click on the records to present single record forms for
the record found.
That's what I do/use.