Warning Message

G

Guest

Hi

I have a buttin on a Form than runs a Macro, basically a couple of Update
Queries moving data from 1 table to another.

The problem i am having is, One person might run the query and import the
data then somebody else could do the same and duplicate the data.

Is there anyway Access can recognise that the query has been run, say
"today" and it will not be able to be run again until tomorrow? or

Can a pop up warning be set when the button is pressed to say "This Macro
has already been run today?"

Any help will be much appreciated.

Thanks
Dave

Can
 
B

Brian

Dava Sutts said:
Hi

I have a buttin on a Form than runs a Macro, basically a couple of Update
Queries moving data from 1 table to another.

The problem i am having is, One person might run the query and import the
data then somebody else could do the same and duplicate the data.

Is there anyway Access can recognise that the query has been run, say
"today" and it will not be able to be run again until tomorrow? or

Can a pop up warning be set when the button is pressed to say "This Macro
has already been run today?"

Any help will be much appreciated.

Thanks
Dave

The smart move would be to properly index your table to prevent duplicates
being added.
 
T

Tom Collins

Brian said:
The smart move would be to properly index your table to prevent duplicates
being added.
Brian's suggestion is a good one, but if it doesn't work with your data, you
could store the date the last time the query was run in another table.

Sub On_Button_Click
Check table_A for date
If Date < today then
Append data to table_B
Update table_A with today's date
End If
ENs Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top