Hi -
I have a form used to enter criteria for display of records on a subform. There is a refresh procedure that is used to update the subform. This procedure is called on load as well as after changing any of the criteria.
This has worked fine on multiple computers running both Access 02 and 03. However, one of my clients has a machine that seems to choke on this procedure. I get the following error message -
"2455: You entered an expression that has an invalid reference to the property Form/Report"
The procedure called is:
Private Sub RefreshSubform()
Dim strSQL As String
strSQL = "SELECT * FROM qryProjectsCases"
If Not (IsNull(BuildFilter)) Then
strSQL = strSQL & " WHERE " & BuildFilter
End If
' Me.frmsubProjCases.Form.RecordSource = strSQL
' Me.frmsubProjCases.Form.Requery
Forms!frmCaseList!frmsubProjCases.Form.RecordSource = strSQL
Forms!frmCaseList!frmsubProjCases.Form.Requery
End Sub
The error occurs at the line where I try to set the record source property for the subform. Note there are two commented lines, this was the original code and experienced the same error. Both methods of referencing the form generate the same error (on this one particular machine - both work on the other machines).
The function BuildFilter generates a SQL string based on the various criteria on the main form. I have even tried setting SQL to a constant, but still get the error.
I have checked to see if the References are complete, but don't find any missing.
Any suggestions?
- g
I have a form used to enter criteria for display of records on a subform. There is a refresh procedure that is used to update the subform. This procedure is called on load as well as after changing any of the criteria.
This has worked fine on multiple computers running both Access 02 and 03. However, one of my clients has a machine that seems to choke on this procedure. I get the following error message -
"2455: You entered an expression that has an invalid reference to the property Form/Report"
The procedure called is:
Private Sub RefreshSubform()
Dim strSQL As String
strSQL = "SELECT * FROM qryProjectsCases"
If Not (IsNull(BuildFilter)) Then
strSQL = strSQL & " WHERE " & BuildFilter
End If
' Me.frmsubProjCases.Form.RecordSource = strSQL
' Me.frmsubProjCases.Form.Requery
Forms!frmCaseList!frmsubProjCases.Form.RecordSource = strSQL
Forms!frmCaseList!frmsubProjCases.Form.Requery
End Sub
The error occurs at the line where I try to set the record source property for the subform. Note there are two commented lines, this was the original code and experienced the same error. Both methods of referencing the form generate the same error (on this one particular machine - both work on the other machines).
The function BuildFilter generates a SQL string based on the various criteria on the main form. I have even tried setting SQL to a constant, but still get the error.
I have checked to see if the References are complete, but don't find any missing.
Any suggestions?
- g
Last edited: