Unanswered: how to query a certain record that is being modified lately?
i am currently having a problem on getting a query that does the following:
- i have a certain products actively involved in circulation and transaction....
- what i need is to query the products by the latest date of circulation/ transaction and to bring it out in a query or report regardless whether the last transaction date is today or the a day few years ago for different products....
DoCmd.RunSQL("INSERT INTO tblTrack ( PartKey ) SELECT " & intKey & " AS PartKey;")
The RunSQL will be faster than using recordsets and the "SetWarnings" will disable the "You're about to add 1 record ..." popup.
Just a Note on the SetWarnings thing too...Be Careful Though not critical it can cause problems if you don't remember to SetWarnings back to TRUE. What I did to avoid that was to use CurrentDB.Execute which I put when running an UpdateQuery. Works fine and nothing to remember to reset. Just a tip from what I have learned.
Just a note of agreement with Bud, and to expand a little. If you do use setwarnings then make sure you handle errors (e.g. on error resume next or set warnings to true in your error handler). If you suddenly find your form changes being saved without you being warned about it you know setwarnings is set to false.
Also, depending on what you want, you can use:
currentdb.execute strSQL, dbFailonError
This means that you aren't asked if you want to insert rows but will get a message if there is a failure