Filtering problem

S

SHIPP

I am working in Access 97. I have a form that contains 2 subforms on tabs. I
have them linked via a project number. This all works fine. However, when I
try to filter the second tab it asks me to input the field name. The code is
as follows.

' Save the Project No. and Year
LetIDYr (Me.sfrmCEBHdr.Form.IDPart1_2YR)
' Filter the subform
Me.sfrmCEBDtl.Form.Filter = "Me.IDPart1_2Yr =" & GetIDYr()
Me.sfrmCEBDtl.Form.FilterOn = True

Every time this code executes it asks me to input Me.IDPart1_2Yr. I have
also tried replacing the line above with

Me.sfrmCEBDtl.Form.Filter = "Me.sfrmCEBDtl.Form.IDPart1_2Yr =" & GetIDYr()

The result is the same. The field IDPart1_2Yr is on the form. The properties
are set to invisible, enabled=no, locked = yes.

Any help would be greatly appreciated.
 
S

SHIPP

Solved the problem. For those interested, this is the code.

' Save a value in subform 1 need to filter subform 2
LetIDYr (Forms!frmCEB.sfrmCEBHdr.Form.CEBYr)
strFlt = "[Yr] = " & GetIDYr()
Forms!frmCEB.sfrmCEBDtl.Form.Filter = strFlt
Forms!frmCEB.sfrmCEBDtl.Form.FilterOn = True
 
Top