Hi guys,
I've seen a few other similar posts, but i still cant figure out exactly what I'm doing wrong or what i need to do to fix it.
I'm trying to find the ID number of the last record in a stored query. This method worked perfectly for a stored table, but with this query reulsts in an invalid operation error.
If I remove the DB_OPEN_TABLE parameter it says "Too few parameters. Expected 34." The criteria for this query has some complicated logic that I would rather not enter in manually, even if I could.
Is there another way to do this?
Here is my code:
Dim db As Database
Dim rs As Recordset
Dim lastn As Integer
Set db = CurrentDb()
Set rs = db.OpenRecordse t("Data Query", DB_OPEN_TABLE)
Do While Not rs.EOF
rs.Move (1)
Loop
lastn = rs![ID]
Me.DataField.Va lue
Any help will save me from a growing headache
Thanks,
Thomas
I've seen a few other similar posts, but i still cant figure out exactly what I'm doing wrong or what i need to do to fix it.
I'm trying to find the ID number of the last record in a stored query. This method worked perfectly for a stored table, but with this query reulsts in an invalid operation error.
If I remove the DB_OPEN_TABLE parameter it says "Too few parameters. Expected 34." The criteria for this query has some complicated logic that I would rather not enter in manually, even if I could.
Is there another way to do this?
Here is my code:
Dim db As Database
Dim rs As Recordset
Dim lastn As Integer
Set db = CurrentDb()
Set rs = db.OpenRecordse t("Data Query", DB_OPEN_TABLE)
Do While Not rs.EOF
rs.Move (1)
Loop
lastn = rs![ID]
Me.DataField.Va lue
Any help will save me from a growing headache
Thanks,
Thomas
Comment