Hello everyone,
I have an interesting problem. This code worked at home on my Win2000 box running Access XP. Now I get to work on a Win2000 box running Access 2000 and I get a run time error '2455' stating that I have an invalid reference to the property recordsource. I've listed the code below. The stars mark the line which I'm having trouble with. Any ideas?
Private Sub SearchButton_Click()
'Initialize our SQL statement
Dim SQLCode As String
SQLCode = "SELECT * FROM [p2addata]"
Dim SQLCondition As String
SQLCondition = BuildSearch
'Combine the SQL statement
If SQLCondition <> " WHERE " Then
SQLCode = SQLCode & SQLCondition
End If
'Run the query
*** ResultsSubForm.Form.RecordSource = SQLCode
End Sub
SQLCode = "SELECT * FROM [p2addata] WHERE [Media_Type]='article'"
Everything is valid in this statement. So I'm at a loss as to why it won't work.
I'm also having problems in my data entry form. I created a command button to save the record (being lazy and using Access's built in code) and that won't work either.
Thanks for all your help! This board is a lifesaver!
Sarah
I have an interesting problem. This code worked at home on my Win2000 box running Access XP. Now I get to work on a Win2000 box running Access 2000 and I get a run time error '2455' stating that I have an invalid reference to the property recordsource. I've listed the code below. The stars mark the line which I'm having trouble with. Any ideas?
Private Sub SearchButton_Click()
'Initialize our SQL statement
Dim SQLCode As String
SQLCode = "SELECT * FROM [p2addata]"
Dim SQLCondition As String
SQLCondition = BuildSearch
'Combine the SQL statement
If SQLCondition <> " WHERE " Then
SQLCode = SQLCode & SQLCondition
End If
'Run the query
*** ResultsSubForm.Form.RecordSource = SQLCode
End Sub
SQLCode = "SELECT * FROM [p2addata] WHERE [Media_Type]='article'"
Everything is valid in this statement. So I'm at a loss as to why it won't work.
I'm also having problems in my data entry form. I created a command button to save the record (being lazy and using Access's built in code) and that won't work either.
Thanks for all your help! This board is a lifesaver!
Sarah