Hi
The program suddenly stopped working and giving the error message at the line of code where two strings are compared. The error message is:
=========================
Run-time error '5':
Invalid procedure call or argument
=============================
The Error was on the line
=> If Me.RecordSource = "Table_1" Then
Part of the source code is:
--------------------------
Option Explicit
Option Compare Database
Private Sub Setup_rs()
If rs Is Nothing Then
=> If Me.RecordSource = "Table_1" Then
Set rs = CurrentDb.OpenRecordset("Table_2")
Else
Set rs = CurrentDb.OpenRecordset("Table_1")
End If
End If
End Sub
------------------------
If I commented out the line
'Option compare database
then, then it does not give any error. I don't understand why there is problem in comparing two strings. By the way, I am using ACCESS 2000 and it was working fine before.
Any suggestions? Thanks.
The program suddenly stopped working and giving the error message at the line of code where two strings are compared. The error message is:
=========================
Run-time error '5':
Invalid procedure call or argument
=============================
The Error was on the line
=> If Me.RecordSource = "Table_1" Then
Part of the source code is:
--------------------------
Option Explicit
Option Compare Database
Private Sub Setup_rs()
If rs Is Nothing Then
=> If Me.RecordSource = "Table_1" Then
Set rs = CurrentDb.OpenRecordset("Table_2")
Else
Set rs = CurrentDb.OpenRecordset("Table_1")
End If
End If
End Sub
------------------------
If I commented out the line
'Option compare database
then, then it does not give any error. I don't understand why there is problem in comparing two strings. By the way, I am using ACCESS 2000 and it was working fine before.
Any suggestions? Thanks.