displaying update query results at msgbox

honnour

Registered User.
Local time
Today, 23:29
Joined
Mar 1, 2012
Messages
43
Hello everybody,

In a USD table I have two fields. ID and dDate
In my form I have a button called update. When user clicks this button an update querry updates the each ID's ddate to date( ) if that ddate is < date( )

What I want to do is when user clicks update button msgbox will appear and it will say for example "545 ID has updated"

How can I do that?
 
Hello everybody,

In a USD table I have two fields. ID and dDate
In my form I have a button called update. When user clicks this button an update querry updates the each ID's ddate to date( ) if that ddate is < date( )

What I want to do is when user clicks update button msgbox will appear and it will say for example "545 ID has updated"

How can I do that?

You will not be able to use the MsgBox to communicate information about the specific record that was updated using the method you have described. While your query will perform the update exactly as you have described, just using the query you have no way of determining which records were updated, especially to know the exact record and be able to display that information to the user. If you want to identify each updated record to the user, then you would need to use VBA code to iterate through each record returned by the query (record set) and either make a list that you could then display to the user or display the MsgBox after each record is updated.

I realize that form your post most likely I do not understand exactly what you are attempting to accomplish, but I am concerned that you are not going to be getting the result that you are looking for. If you have 10 records in your table and each of them has a different date then the first time you run your query it will only update records where the dDate is < than the current date. However, as the days go by, you will eventually come to the point that every record in your table will be being updated at the same time. If that is what you are looking for then that is fine but I suspect that it is not what you are expecting unless you are using more criteria in your query than you have explained in your post.

You might consider displaying a list records that might need to be updated to your user and let them select one or more that need to be updated. If you do it this way you can determine which record they selected and/or updated.

Just my thoughts.
 

Users who are viewing this thread

Back
Top Bottom