Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-Time Error

Status
Not open for further replies.

sedixon

Technical User
Apr 15, 2002
12
US
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 <> &quot; WHERE &quot; Then
SQLCode = SQLCode & SQLCondition
End If

'Run the query
*** ResultsSubForm.Form.RecordSource = SQLCode

End Sub

SQLCode = &quot;SELECT * FROM [p2addata] WHERE [Media_Type]='article'&quot;

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top