2010 equiv for set rst

Rich

Registered User.
Local time
Today, 12:31
Joined
Aug 26, 2008
Messages
2,898
Had to "upgrade " to 2010 from 97, Is there a different method of doing this it worked in 2007:o
Set rst = dbs.OpenRecordset(strSQL)
 
No, it shouldn't change. What's the specific error and maybe showing a bit more code will help.
 
Error 13 TypeMismatch, it is just that line that I posted. I don't know where the references are to see if it's one missing
 
The thought I have is that rst is not what is expected... Did you dim it as "Dim rst As DAO.Recordset" ?

For References, it's Tools -> References but I expect DAO to be present as default, though. Is that only one line of code - what's the whole procedure?
 
It's everywhere that use Rs, this is just one of them

Dim rs As Recordset
Dim result


On Error GoTo Err_RunSum
' Get the form Recordset.
Set rs = F.RecordsetClone
' Find the current record.
Select Case rs.Fields(KeyName).Type
' Find using numeric data type key value?
Case DB_INTEGER, DB_LONG, DB_CURRENCY, _
DB_SINGLE, DB_DOUBLE, DB_BYTE
rs.FindFirst "[" & KeyName & "] = " & KeyValue
' Find using date data type key value?
Case DB_DATE
rs.FindFirst "[" & KeyName & "] = #" & KeyValue & "#"
' Find using text data type key value?
Case DB_TEXT
rs.FindFirst "[" & KeyName & "] = '" & KeyValue & "'"
Case Else
MsgBox "ERROR: Invalid key field data type!"
GoTo Bye_RunSum
End Select
 
So what about the references? Have you checked what Banana mentioned?
 
I've checked the references, but can't see any missing, but that's not all. rs.FindFirst errors as well, Method or data member not found:o
 
Rich

Dim rs As Recordset

Should be

Dim Rs As DAO.Recordset

Make sure you have Microsoft Object DAO 3.x referenced
 
Rich

Dim rs As Recordset

Should be

Dim Rs As DAO.Recordset

Make sure you have Microsoft Object DAO 3.x referenced
I think Banana mentioned these two points in his earlier post.
 
The code works fine in 2007, there are loads of errors in 2010:mad:
 
Sounds like Rich is having fun in 2010!!

As mentioned twice already, have you tried:

Code:
Dim rs As DAO.Recordset

instead of just

Code:
Dim rs As Recordset
?
 
I went to my daughters, converted and saved to 2007, came home and repaired the access inst. opened the new version and voila, most of it worked including my switchboard to hide that ugly bloody window. Now all I've got to figure out is how to get my custom menus to show and work:D
 
Yay! :D It's done in XML. Lookup Customizing the Office Fluent Ribbon on google. But I hear there's an interface for doing it in 2010 so you may want to check that option out. I think it's called backstage.
 
I have to find the new code to maximise and restore the Access window first, I'll be back in about 3months:eek:
 
The maximise part works, the menu button simply calls a Restore function etc. I guess the only way is to use the close event of the Reports that had the menu bar attached. I have to say though in 2010 defence, it's much faster and the graphs actually display which they didn't in Vista
 

Users who are viewing this thread

Back
Top Bottom