Access MS Access 2003, problem filtering subform

Joined
Jul 3, 2007
Messages
1
Reaction score
0
Hello,

I'm running Access 2003 trying to filter a subform with approximately 15 records per year per the main record contained on the parent form. The filter works fine if the subform is opened independently, and right-clicking on the subform after opening the main form, and choosing filter by selection also works. The problem is getting the filter to apply when the parent form opens.

I've checked for spelling errors a dozen times, what I currently have for code is:

Private Sub CboConventionName_AfterUpdate()
Dim lngHistYear As Long
Dim strFilterYear As String

lngHistYear = 1990
strFilterYear = "Year = " & lngHistYear
DoCmd.OpenForm "frmConvInformation", acNormal, , "ConvId =" & Me!CboConventionName.Value, , acHidden
Forms!frmConvInformation!sfrmHistory.Form!Filter = strFilterYear
Forms!frmConvInformation!sfrmHistory.Form!FilterOn = True
Forms!frmConvInformation.Visible = True

End Sub.

This produces an error message claiming that Access can't find the sfrmHistory referred to in lines 8 & 9 of the code above.

I have also tried substituting the subform control name (PagHistory) instead of the subform name. This produces a different error message: Object doesn't support this property or method.

Anyone have ideas?

Thanks...
Scott
 

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

Top