T
Tony Scullion
I have a main form (frmMainFrom) which shows a farmer and
his/her details. There is approx 400 farmers so far. I
have a created a search form (frmSearch) with subform
(frmSearchSubForm) to search on various fields. If my
search from returns only 19 farmers that match a search
how do I open/filter the main form to show these 19
records only. The code below is what I use to open it for
a single record, can this be amended expanded to cater for
multiple records.
TIA
Tony
********code start
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmMainForm"
stLinkCriteria = "[FarmerID] = " & Me![FarmerID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms("frmSearch").Visible = False
********code end
his/her details. There is approx 400 farmers so far. I
have a created a search form (frmSearch) with subform
(frmSearchSubForm) to search on various fields. If my
search from returns only 19 farmers that match a search
how do I open/filter the main form to show these 19
records only. The code below is what I use to open it for
a single record, can this be amended expanded to cater for
multiple records.
TIA
Tony
********code start
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmMainForm"
stLinkCriteria = "[FarmerID] = " & Me![FarmerID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms("frmSearch").Visible = False
********code end