Using a tab control, I am setting the recordsource value of a form
using the following code (both the form filter property and the subform
link child/master fields are not used):
***********************************
Private Sub TabCtl37_Change()
Dim SRrecordset
Select Case Me.TabCtl37.Value
Case 0
SRrecordset = "SELECT * From SRtbl WHERE
(((SiteCode)=[Forms]![Site].[Form]![SiteCode]) AND ((Cancelled)=False)
AND ((Accept_Act) Is Null)) ORDER BY SR_Entered_Act;"
Me.RecordSource = SRrecordset
Case 1
SRrecordset = "SELECT * From SRtbl WHERE
(((SiteCode)=[Forms]![Site].[Form]![SiteCode]) AND (((Cancelled)=True)
OR ((Accept_Act) Is Not Null))) ORDER BY Install_Act;"
Me.RecordSource = SRrecordset
Case 2
SRrecordset = "SELECT * From SRtbl ORDER BY SR;"
Me.RecordSource = SRrecordset
End Select
End Sub
************************************************** *******
Case 2 is not working. There seems to be a hang up in the form that
forces it to filter based on the SiteCode field--though it is only used
in the form from the above sql statements. Can someone give me some
insight as to why the explicit recordsource is being ignored? The
exact same code is in a compiled mde released version in my user base
and is working fine. (this is not the first time that i have noticed
that code that works one day all of a sudden stops working despite no
changes to that code.)