Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-access > #11717 > unrolled thread

Access 2016 - How to use a Data Macro...

Started byBruno Campanini <brunocam@libero.it>
First post2016-03-27 01:52 +0100
Last post2016-03-29 06:52 -0700
Articles 4 — 2 participants

Back to article view | Back to comp.databases.ms-access


Contents

  Access 2016 - How to use a Data Macro... Bruno Campanini <brunocam@libero.it> - 2016-03-27 01:52 +0100
    Re: Access 2016 - How to use a Data Macro... Patrick Finucane <patrickfinucanetx@gmail.com> - 2016-03-28 06:40 -0700
      Re: Access 2016 - How to use a Data Macro... Bruno Campanini <brunocam@libero.it> - 2016-03-29 01:51 +0200
        Re: Access 2016 - How to use a Data Macro... Patrick Finucane <patrickfinucanetx@gmail.com> - 2016-03-29 06:52 -0700

#11717 — Access 2016 - How to use a Data Macro...

FromBruno Campanini <brunocam@libero.it>
Date2016-03-27 01:52 +0100
SubjectAccess 2016 - How to use a Data Macro...
Message-ID<nd7at2$te1$1@gioia.aioe.org>
... to run a VBA Sub/Function.

I was only able to have a data macro to send a mail.
But I would activate VBA code from within a data macro,
e.g. showing a message box after deleting a table record,
and so on.

I read some script in the Internet but I was unable
to have they working.

Bruno

[toc] | [next] | [standalone]


#11718

FromPatrick Finucane <patrickfinucanetx@gmail.com>
Date2016-03-28 06:40 -0700
Message-ID<3b583a06-996c-4ded-9473-e0a7324b0cf2@googlegroups.com>
In reply to#11717
On Saturday, March 26, 2016 at 8:52:59 PM UTC-4, Bruno Campanini wrote:
> ... to run a VBA Sub/Function.
> 
> I was only able to have a data macro to send a mail.
> But I would activate VBA code from within a data macro,
> e.g. showing a message box after deleting a table record,
> and so on.
> 
> I read some script in the Internet but I was unable
> to have they working.
> 
> Bruno

I read the following.  It may help you.
You can do this, but it not recommend. Remember, table triggers and store procedure code does run independent of VBA and in fact it runs even if you don't have Access installed.

However, assuming you going to be using Access to always edit the data (a reasonable assumption), then you can in fact have the table macro call VBA code. There are several ways of doing this, but the most common and useful is to set SetLocalVar to a VBA function. This has the added bonus of being able to pass some values to that function which in most cases is likely required.

So, keep in mind you can call VBA code, but then you are adding creating a dependence from your tables to VBA.

So just use SetLocalVar to some dummy var, and place the VBA function in the expression.

[toc] | [prev] | [next] | [standalone]


#11719

FromBruno Campanini <brunocam@libero.it>
Date2016-03-29 01:51 +0200
Message-ID<ndcg1i$nav$1@gioia.aioe.org>
In reply to#11718
Patrick Finucane pretended :
> On Saturday, March 26, 2016 at 8:52:59 PM UTC-4, Bruno Campanini wrote:
>> ... to run a VBA Sub/Function.
>> 
>> I was only able to have a data macro to send a mail.
>> But I would activate VBA code from within a data macro,
>> e.g. showing a message box after deleting a table record,
>> and so on.
>> 
>> I read some script in the Internet but I was unable
>> to have they working.
>> 
>> Bruno
>
> I read the following.  It may help you.
> You can do this, but it not recommend. Remember, table triggers and store 
> procedure code does run independent of VBA and in fact it runs even if you 
> don't have Access installed.
>
> However, assuming you going to be using Access to always edit the data (a 
> reasonable assumption), then you can in fact have the table macro call VBA 
> code. There are several ways of doing this, but the most common and useful is 
> to set SetLocalVar to a VBA function. This has the added bonus of being able 
> to pass some values to that function which in most cases is likely required.
>
> So, keep in mind you can call VBA code, but then you are adding creating a 
> dependence from your tables to VBA.
> gears?


> So just use SetLocalVar to some dummy var, and place the VBA function in the 
> expression.

I read about this SetLocalVar system and also about the
LookupRecord system, but no ones is working with me.
Windows 10 Pro, Access 2016, 64bit

Did you try with your gear???

Bruno

[toc] | [prev] | [next] | [standalone]


#11720

FromPatrick Finucane <patrickfinucanetx@gmail.com>
Date2016-03-29 06:52 -0700
Message-ID<d6a6a012-5450-4379-a84f-b3a87f0f601d@googlegroups.com>
In reply to#11719
On Monday, March 28, 2016 at 7:51:20 PM UTC-4, Bruno Campanini wrote:
> Patrick Finucane pretended :
> > On Saturday, March 26, 2016 at 8:52:59 PM UTC-4, Bruno Campanini wrote:
> >> ... to run a VBA Sub/Function.
> >> 
> >> I was only able to have a data macro to send a mail.
> >> But I would activate VBA code from within a data macro,
> >> e.g. showing a message box after deleting a table record,
> >> and so on.
> >> 
> >> I read some script in the Internet but I was unable
> >> to have they working.
> >> 
> >> Bruno
> >
> > I read the following.  It may help you.
> > You can do this, but it not recommend. Remember, table triggers and store 
> > procedure code does run independent of VBA and in fact it runs even if you 
> > don't have Access installed.
> >
> > However, assuming you going to be using Access to always edit the data (a 
> > reasonable assumption), then you can in fact have the table macro call VBA 
> > code. There are several ways of doing this, but the most common and useful is 
> > to set SetLocalVar to a VBA function. This has the added bonus of being able 
> > to pass some values to that function which in most cases is likely required.
> >
> > So, keep in mind you can call VBA code, but then you are adding creating a 
> > dependence from your tables to VBA.
> > gears?
> 
> 
> > So just use SetLocalVar to some dummy var, and place the VBA function in the 
> > expression.
> 
> I read about this SetLocalVar system and also about the
> LookupRecord system, but no ones is working with me.
> Windows 10 Pro, Access 2016, 64bit
> 
> Did you try with your gear???
> 
> Bruno

I've never written or used a data macro.  Just provided some info posted by another.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.databases.ms-access


csiph-web