Go Back   Access World Forums > Microsoft Access Discussion > Macros

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-04-2019, 01:32 AM   #16
Tezal
Newly Registered User
 
Join Date: Sep 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Tezal is on a distinguished road
Re: Using Triggers in Access 2016

Hi,

this is what I used:

Data Macro "After Insert"

Command > SetLocalVar , expression: ="=TestMe()"
(I read a post saying it is nececssary to use 2 "=", including the one already there. tried both though)

Function in Module
Module1, Public Function TestMe()


@June7, I can imagine a vba sql insert command working, but that is still not an external application, right?

Tezal is offline   Reply With Quote
Old 10-04-2019, 02:16 AM   #17
June7
AWF VIP
 
June7's Avatar
 
Join Date: Mar 2014
Location: The Great Land
Posts: 2,266
Thanks: 0
Thanked 532 Times in 528 Posts
June7 will become famous soon enough June7 will become famous soon enough
Re: Using Triggers in Access 2016

No external app involved in my testing.
__________________
Attach File Manager is below Advanced editor window, click Go Advanced below Quick Reply window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
June7 is offline   Reply With Quote
Old 10-04-2019, 03:22 AM   #18
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 12,127
Thanks: 81
Thanked 2,009 Times in 1,957 Posts
jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light
Re: Using Triggers in Access 2016

Tezal,

Here is a link to info on using data macros for audit logging. This was part of my "dabbling" with data macros. There is a sample database that you could review to see if any of it is relevant to your situation. Specific info in post 14 thru 21.
Good luck.

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jdraw is offline   Reply With Quote
Old 10-04-2019, 04:30 AM   #19
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 11,232
Thanks: 40
Thanked 3,643 Times in 3,513 Posts
CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light
Re: Using Triggers in Access 2016

good link from jdraw. Makes me think that the problem might not be with the macro not being triggered but that the macro cannot actually do what is asked of it (i.e. display the message) since Access is not actually open. Perhaps change the macro to do something else such as insert a record?
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Old 10-04-2019, 09:02 AM   #20
Tezal
Newly Registered User
 
Join Date: Sep 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Tezal is on a distinguished road
Re: Using Triggers in Access 2016

Thanks.

The content of the vba function triggered is not the problem, it works fine when triggered through manual inserting a record. Only when trying to do this with an external application the error occurs, even when a test function contains no code at all.
I'm starting to think it has to do with permissions (window user/uac level) or such.

The ultimate thing I am trying to do here is not even the insert itself, that was just to bridge and trigger the trigger
What I am really trying to do is to get an external application directly trigger a vba function in the Access database, while passing two parameters.
This function does a lot: copy a table, creating and populating an excel file, and email it.
Tezal is offline   Reply With Quote
Old 10-04-2019, 09:28 AM   #21
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 11,232
Thanks: 40
Thanked 3,643 Times in 3,513 Posts
CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light
Re: Using Triggers in Access 2016

OK, it's not my area of expertise so I'll butt out

__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2003 V 2016 What can 2016 do? Mike375 General 8 01-03-2019 06:29 AM
Deploying Access 2016 Front End, Access 2016 RossWaddell General 2 07-24-2016 05:43 AM
Ms Access 2003 + Triggers RynoB General 2 10-04-2007 11:00 AM
Cannot RAISERROR in Triggers after upgrading to Access 2003 windy SQL Server 0 03-20-2006 04:27 PM
Is it possible to create triggers in Access Satheeshkumar N Queries 1 03-03-2005 02:16 PM




All times are GMT -8. The time now is 11:12 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World