Filtering SUBFORM

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Good day!

I have a form that will search for records in my subform.

I have a textbox in my CUSTOMER form where users can type-in any strings.
Once the SEARCH command button is clicked, it will search all records in my
SUBFORM that has similar (LIKE) strings encoded in the textbox.

I know how to filter records in a form, but searching records in a SUBFORM
is now a different thing for me...

Any help will be appreciated...


Thank you


Amsuria

I can
 
Hello Amsuria,

Doing searches in a subform is the same thing that you normally do for
forms. You just have to made proper refferences.
Example: (place this code on the AfterUpdate event on your control
(named MyControl - located on the main form) where the users must enter
search string)

Me.RecordsetClone.FindFirst "[FieldName] = '" & MyControl & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
MyVar = MyControl.Value
Forms![Main Form]![Child Form].SetFocus
Me.Refresh
Forms![Main Form]![Child Form]![Control on the child form].SetFocus
DoCmd.FindRecord MyVar, , , , , acAll, True

Off course you can do a LIKE search easily.

Marry Christmas!
 

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

Back
Top