|
 |
access thread: MAXRECORDS/TOP VALUES for query through sql/vba
Message #1 by amy.bender@p... on Thu, 23 Jan 2003 18:36:59
|
|
I have a form that assigns x number of records to a person in my database.
I just recently found the top values or maxrecords property within a
query, but I can't use a standard query in my application, I need to hard
code it.
Does anyone know how to set this value in code?
For example...
docmd.runsql "UPDATE tbl_Assignments SET [auditor] = '" & strauditor & "'
WHERE " & strcriteria
I have a variable set with the number of records I want updated, but don't
know how to easily set that in the above sql statement.
Please help! Much obliged!
Message #2 by "Wayne Ryan" <wayne.ryan@t...> on Fri, 24 Jan 2003 19:18:00
|
|
Amy,
The Top predicate might not necessarily return the amount of records
that you think. If the are "ties" you will get more records.
If standard queries are out, meaning that you can't do an update
query on your TOP query, then you might have to use recordsets.
Just make sure to process all the records not just the Top n that
you think might be there.
hth,
Wayne
|
|
 |