I am having some trouble, I am trying to create an advanced search form which will open up as a popup from my main search from.
I am using the Allen Browne method of creating the where string however I am setting the recordsource of the subform with a constructed sql string, not filtering.
My main form contains a subform which my basic search selects perfectly. However I cant seem to be able to get my advanced search to point down to the sub form correctly. I usually get the error "This object does not support this property or method" which keeps poping up everytime I close resulting in having to close access through task manager.
Below is the code I use to point to the record source of the main forms sub form:
Expand|Select|Wrap|Line Numbers
- 'Finally, apply the string as a query of the recordsource
- Dim topinsert2 As String
- If comboNrecords2 = "All" Then
- topinsert2 = "All "
- Else
- topinsert2 = "TOP " & comboNrecords2 & " "
- End If
- Forms!frmlogforfiltering!subfrmlogforfiltering.RecordSource = "Select " & topinsert2 & " * FROM logforfiltering WHERE " & strwhere2
my sub form: subfrmlogforfiltering
my advanced search form: frmAdvancedSearch
Thanks for any help,
Chris