No Current Record?

L4serK!LL

Registered User.
Local time
Today, 10:16
Joined
Jul 22, 2002
Messages
59
Code:
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("Tikking")
'rst.MoveLast
rst.MoveFirst
While (rst![ID] <> tikking)
    rst.MoveNext
Wend
... ain't working because I get "No Current Record" on the while line :(
(the table "Tikking" got about 9000 records so not a chance it's empty :p )

What should I do?
 
Have you declared what tikking is in
'While (rst![ID] <> tikking)' and is ID the correct field to compare.
Also it will keep looping until it finds a match for <>tikking. If it reaches rst.EOF before finding a match, there will be no currect record, hence the error.
 
'tikking' is the dropdown box, the piece of code comes from the AfterUpdate of tikking...

Code:
While ((Not rst.EOF) And rst![ID] <> tikking)
... gives me the same error :(
 
Have you tried

While ((Not rst.EOF) And rst![ID] <> Me.tikking)

(Also, have you changed the recordsource of the form recently?. To be safe, remove the recordsource of the form, save it, reset the recordsource of the form and save it again.
Check that the table name is not a typo also;))

If you are trying to find a particular record in the recordset, look up the findfirst method in help.
 
Fizzio said:
If you are trying to find a particular record in the recordset, look up the findfirst method in help.
I am indeed but access tells me I can't use the FindFirst method as it is not supported for this type of objects or something like that :(
 
Is the recordsource for the form the table "Tikking"?

If so, this line will find a record in a form.

Me.RecordsetClone.FindFirst "[ID] = " & Me.tikking

If you are looking to something other than finding a record in a form, get back.
 
It would make life less confusing if your table was called tblTikking and your combo was called cboTikking. Not that this helps with your current problem...
 

Users who are viewing this thread

Back
Top Bottom