I am getting a runtime error of '2001' Previous operation canceled when I attempt to set the record source of a form at run time. This is in Access 97. I suspect the where clause is causing the problem as "SELECT * FROM qryFrmVariancesSource" seems to be working fine. Could someone take a look. Thanks.
Dim str As Variant
Dim strArgs As String
strArgs = Me.OpenArgs
str = MySplit(strArgs, ";")
'Debug.Print str(1) & vbTab & str(2)
'Debug.Print "SELECT * FROM qryFrmVariancesSource WHERE TO = " & str(1)
Me.RecordSource = "SELECT * FROM qryFrmVariancesSource WHERE [TO] = " & str(1)