Access - Macros Issues

PrettyMess

Board Regular
Joined
Feb 10, 2015
Messages
66
Hi All

Would anyone know how to link a stand alone macro to automatically run against a table or query?

I have tried most other methods and none of them really do what I am looking so this is a last ditch effort

Any help would be greatly appreciated.

Thanks Paula
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Paula

What do you mean by a 'stand alone' macro?

Also, in what way would you want to link the macro to the table/query?

PS Couldn't you refer to the specific table/query in the macro?
 
Upvote 0
I am looking for an email with object attached to be sent each time the 'username table' is updated however the only way I can find of doing this is through creating a basic macro I have linked it to the 'username table' in the sense that it will now send an email but I cannot get it to work when the 'username table' is updated.
The only way I could see round this would be to put it into the after insert function on the table itself but I cant seem to find a way to link this.
 
Upvote 0
Do you mean you want to run a macro automatically when a table is updated?
 
Upvote 0
that's it exactly - however there is a bit of a catch with it as this table automatically updates so I don't want any user interaction in this table so to speak

best way to explain is:

All Information table is linked to a user form - these changes update to all information table - they also replicate into an audit table - and then replicate into my username table.
 
Upvote 0
I'm afraid Access doesn't have any triggers/events for tables/queries.

How exactly is the automatic update happening?

Could you perhaps call/run the macro from the userform?
 
Upvote 0
Would it work any better if I swapped from a table/query to a report? is there anyway to trigger these?

Currently the automatic updates are taking place through after insert and after update macros.

I cant really push this from the user form as there is no submit button so to speak and a lot more information stored on the form than what I require to go out in the email.
 
Upvote 0
Can't you just run the email macro from either the after insert or after update macro?
 
Upvote 0
I thought I could with the SendEmail function inside both of these macros but it doesn't seem to work correctly, It doesn't allow you to attach a document to the email.
 
Upvote 0
Have you tried using RunMacro to run the 'stand alone' macro from one of the update/insert macros?
 
Upvote 0

Forum statistics

Threads
1,221,827
Messages
6,162,200
Members
451,753
Latest member
freddocp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top