findfirst in recordset (URGENT)

pnrjack
05-30-2002, 09:46 AM
I am trying to use the findfirst for a recordset rs but it is giving me this error: Operation is not supported for this type of object #3251. Here is the code:

ElseIf strID <> "" Then
rs.MoveFirst
criteria = "SocialSecurityNumber LIKE'" & strID & "'"
rs.FindFirst (criteria)
If (rs.Fields("SocialSecurityNumber").Value) = (strID) Then
empID = rs.Fields("[SocialSecurityNumber]").Value
lastName = rs.Fields("LastName").Value
firstName = rs.Fields("FirstName").Value
End If
Call accumulate(commission)
rs.MoveNext
End If

Any help would be greatly appreciated

ScotK
05-30-2002, 10:01 AM
I think the problem is in how you opened the recordset, show the code that opens it.

pnrjack
05-30-2002, 10:05 AM
Private Sub Form_Load()
Set data1 = OpenDatabase(App.Path & "\TechHeadsDatabase_2.mdb")
Set rs = data1.OpenRecordset("Employees")
End Sub

ScotK
05-30-2002, 10:13 AM
Try,


Private Sub Form_Load()
Set data1 = OpenDatabase(App.Path & "\TechHeadsDatabase_2.mdb")
Set rs = data1.OpenRecordset("Employees",dbOpenSnapshot)
End Sub


I think that will let you do the find but depending on what else your doing it may cause a problem elsewhere, anyway I think you need to look at the options you use when you open it.

pnrjack
05-30-2002, 10:34 AM
I actually opened it as a dynaset and it is working good. I am having a little problem with printing on one of the queries but hopefully that will be easy enough to fix. Thanks for your help.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum