Cotswold
Active member
- Local time
- Today, 04:43
- Joined
- Dec 31, 2020
- Messages
- 528
I have the strangest error that I cannot find solution to.
I have a Form with a SubForm. The subform is the one with the data linked to the table with a Query.
In the code below it fails at Line 5 with the error 2580; "The recordsource "Q20CensusName_FiltName" specified does not exist on this form or report"
The Query stated does exist. In fact, if I change the QueryName to the one that is used when the form opens in line 5, it will also fail with 2580.
The actual cause of the error I cannot see, but it must be simple.
I have a Form with a SubForm. The subform is the one with the data linked to the table with a Query.
In the code below it fails at Line 5 with the error 2580; "The recordsource "Q20CensusName_FiltName" specified does not exist on this form or report"
Code:
01 If Me!fFiltOnOff = False Then
02 If Len(Trim(Me!fFiltName)) > 3 Then
03 Me!fFiltName = UCase(Me!fFiltName)
04 'Forms!F20CensusMain!F20CensusSub.Form.RecordSource = "Q20CensusName_FiltName"
05 Me.F20CensusSub.Form.RecordSource = "Q20CensusName_FiltName"
06 Me!fFiltOnOff = True
07 Else
08 mOk = MsgBox("Your filter name must be four or more characters long!", 0, "FILTER SETTING ERROR")
09 End If
10 Else
11 Me!fFiltOnOff = False
12 Forms!F20CensusMain!F20CensusSub.Form.RecordSource = "Q20CensusName"
13 End If
The Query stated does exist. In fact, if I change the QueryName to the one that is used when the form opens in line 5, it will also fail with 2580.
The actual cause of the error I cannot see, but it must be simple.