HI to all I need help. I have created a database that updates information daily, in order to start the update I have to run three queries (append, make and update). I already added the code to run the queries at the same time with the push of a button, but I would like to display the users information showing if the information was updated correctly. Just a window maybe displaying "Update successful!", that way the users know that the update worked, if not they could press the command button more than once, therefore appending the information more the once. Also if I could find a way to only limit one update a day based on date() would be great. Please let me know if anybody can help.....Thanks .
Show Status of Updates to users
Collapse
X
-
Instead of a message, try turning your mouse cursor to an hourglass and back. The code is as follows:
Regarding preventing duplicate updates, I suggest the following:Code:DoCmd.Hourglass True DoCmd.Echo False 'Your Code here >>>>>>DoCmd.OpenQuery, etc. DoCmd.Echo True DoCmd.Hourglass False
1. Add a new field to your table>>>DateLas tModified (datatype= dateTime)
2. Add this field to your update query.
3. Place the following constraint in the criteria row of new field ..... <> Date()
4. Test it out. It should update only those records with a date different than today. -
In order to prevent double input of data, suggest you look at the primary key you have assigned to the receiving table. If you choose correctly, you can be sure that duplication is impossible.Originally posted by mld01sAlso if I could find a way to only limit one update a day based on date() would be great.
Regarding recording of update timing, I'd suggest an approach which uses a log table to which an entry is added at the end of each successful update. That way before allowing an update, you could read the date and time of the most recent event and either prevent a further update, or perhaps issue a caution message.Comment
Comment