Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform Code Help... 1

Status
Not open for further replies.

Rjc8513

Technical User
Feb 12, 2001
140
US
Can someone tell me how to refer to the Recordset Clone to further filter the results displayed in the subform? The user selects the [ID NO] from the cbxFind combo box.

Public Sub cbxFind_AfterUpdate()

Dim rstOrig As Recordset
Set rstOrig=Me.RecordsetClone
rstOrig.FindFirst " [ID NO]='" & Me![cbxFind] & "'"
If Not rstOrig.NoMatch Then Me.Bookmark=rstOrig.Bookmark

End Sub

After the above is executed, I want the user to enter a date and click a command button that will further filter the above down to the date.

Help!
 
Typically, a subform is a subset of related records in a subtable to a primary record in a main table. This relationship defines the first stage of filtering. If the link master/child fields are set correctly this filtering is performed automatically. Further filtering of the subform can be done several different ways and would depend on how the subform is being displayed. If the subform is a form view itself you could include the find combobox on it's header. You can even use the combobox wizard to create the find record code for you but you'll need to modify it slightly to allow for the subform being nested in the mainform (Forms!MainFormName!SubFormName!ControlName). If the subform is in continous form or datasheet you have two ways of performing the find record action. One is the use of the recordsetclone/move to record, the other is to filter the subform based on the choice(s). There are pros and cons either way. Moving to the record still allows all the other records to be displayed and is sometimes not very evident that an action was performed. Filtering reduces the number of records being displayed but you'll need to give your users a "Show All" choice in the combobox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top