Trigger equivalent in Access?

B

bill morgan

Friends,

In SQL Server, I can set a Trigger that will automatically
respond to data inserted into Table_A,[Field_1] by
inserting that same data into Table_B,[Field_1].

Is there any way to accomplish this same effect in Access,
independent of forms/reports (and Code-Behind-Forms)?

Thanks,

Bill
 
S

Sylvain Lafontaine

Are you talking about an Access database, with a MDB file, or about Access
as a Front-End with SQL-Server as the Back-End?

In the first case, the answer is no and for the second, there is no
difference on the SQL-Server side about triggers when Access is used as the
FE.

S. L.
 
B

Bill Morgan

S.L.,

I was taling about Access as an MDB file. A Trigger
feature in Access would be a great enhancement - maybe
some day .... Thanks for your input.

B.
-----Original Message-----
Are you talking about an Access database, with a MDB file, or about Access
as a Front-End with SQL-Server as the Back-End?

In the first case, the answer is no and for the second, there is no
difference on the SQL-Server side about triggers when Access is used as the
FE.

S. L.

bill morgan said:
Friends,

In SQL Server, I can set a Trigger that will automatically
respond to data inserted into Table_A,[Field_1] by
inserting that same data into Table_B,[Field_1].

Is there any way to accomplish this same effect in Access,
independent of forms/reports (and Code-Behind-Forms)?

Thanks,

Bill


.
 
B

Bill Morgan

That's what I figured, but thought maybe I was missing
something. Thanks for your input...
-----Original Message-----
Simple answer - nope.

Friends,

In SQL Server, I can set a Trigger that will automatically
respond to data inserted into Table_A,[Field_1] by
inserting that same data into Table_B,[Field_1].

Is there any way to accomplish this same effect in Access,
independent of forms/reports (and Code-Behind-Forms)?

Thanks,

Bill

.
 
J

JIMMIE WHITAKER

in code, you can write statements that can duplicate "triggers". triggers
is just a term. No different that using query grid verses writing a sql
statement in vb code.
Bill Morgan said:
S.L.,

I was taling about Access as an MDB file. A Trigger
feature in Access would be a great enhancement - maybe
some day .... Thanks for your input.

B.
-----Original Message-----
Are you talking about an Access database, with a MDB file, or about Access
as a Front-End with SQL-Server as the Back-End?

In the first case, the answer is no and for the second, there is no
difference on the SQL-Server side about triggers when Access is used as the
FE.

S. L.

bill morgan said:
Friends,

In SQL Server, I can set a Trigger that will automatically
respond to data inserted into Table_A,[Field_1] by
inserting that same data into Table_B,[Field_1].

Is there any way to accomplish this same effect in Access,
independent of forms/reports (and Code-Behind-Forms)?

Thanks,

Bill


.
 
D

Douglas J. Steele

While you're right that a trigger is just code, triggers run automatically
when you insert data into a table, for instance. There's no way to make code
run automatically in Access when you insert data into a table.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



JIMMIE WHITAKER said:
in code, you can write statements that can duplicate "triggers". triggers
is just a term. No different that using query grid verses writing a sql
statement in vb code.
Bill Morgan said:
S.L.,

I was taling about Access as an MDB file. A Trigger
feature in Access would be a great enhancement - maybe
some day .... Thanks for your input.

B.
-----Original Message-----
Are you talking about an Access database, with a MDB file, or about Access
as a Front-End with SQL-Server as the Back-End?

In the first case, the answer is no and for the second, there is no
difference on the SQL-Server side about triggers when Access is used as the
FE.

S. L.

Friends,

In SQL Server, I can set a Trigger that will automatically
respond to data inserted into Table_A,[Field_1] by
inserting that same data into Table_B,[Field_1].

Is there any way to accomplish this same effect in Access,
independent of forms/reports (and Code-Behind-Forms)?

Thanks,

Bill


.
 
J

JIMMIE WHITAKER

Actually there is, by runing a function if the id number or whatever indexed
number is larger. Some before update and after update takes care of this.
You just need the if or case statements to decide what to do. A trigger is
nothing more than a flag. I have some on delete code that cleans up linked
tables. If you can say true or false, you can write code to do something
based on an action. I wish these modern people would quit coming up with so
many new buzz words. A trigger is nothing more than :

If myflag = 0 then put your hands on your head
OR
If myflag = 0 call myfunctiondeletethedangrecord
OR
just about anything you want if this flag you set up is 0.

heck, you could send a rocket to the moon in code if this flag is 0.
WHATEVER.

Douglas J. Steele said:
While you're right that a trigger is just code, triggers run automatically
when you insert data into a table, for instance. There's no way to make code
run automatically in Access when you insert data into a table.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



JIMMIE WHITAKER said:
in code, you can write statements that can duplicate "triggers". triggers
is just a term. No different that using query grid verses writing a sql
statement in vb code.
Bill Morgan said:
S.L.,

I was taling about Access as an MDB file. A Trigger
feature in Access would be a great enhancement - maybe
some day .... Thanks for your input.

B.
-----Original Message-----
Are you talking about an Access database, with a MDB
file, or about Access
as a Front-End with SQL-Server as the Back-End?

In the first case, the answer is no and for the second,
there is no
difference on the SQL-Server side about triggers when
Access is used as the
FE.

S. L.

Friends,

In SQL Server, I can set a Trigger that will
automatically
respond to data inserted into Table_A,[Field_1] by
inserting that same data into Table_B,[Field_1].

Is there any way to accomplish this same effect in
Access,
independent of forms/reports (and Code-Behind-Forms)?

Thanks,

Bill


.
 
D

Douglas J. Steele

You're missing the point.

There is no way in Access to guarantee that code is automatically run when
you insert data into a table. Sure, you can run any code you want in your
application, but remember that anyone can link to your database and insert
data into your table without using your interface, thereby bypassing
whatever code you want run. Yes, you can check after the fact and run your
code, but if it was to prevent specific data from being entered, or to
ensure that additional data was inserted into another table, your code may
be too late to be effective.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



JIMMIE WHITAKER said:
Actually there is, by runing a function if the id number or whatever indexed
number is larger. Some before update and after update takes care of this.
You just need the if or case statements to decide what to do. A trigger is
nothing more than a flag. I have some on delete code that cleans up linked
tables. If you can say true or false, you can write code to do something
based on an action. I wish these modern people would quit coming up with so
many new buzz words. A trigger is nothing more than :

If myflag = 0 then put your hands on your head
OR
If myflag = 0 call myfunctiondeletethedangrecord
OR
just about anything you want if this flag you set up is 0.

heck, you could send a rocket to the moon in code if this flag is 0.
WHATEVER.

Douglas J. Steele said:
While you're right that a trigger is just code, triggers run automatically
when you insert data into a table, for instance. There's no way to make code
run automatically in Access when you insert data into a table.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



JIMMIE WHITAKER said:
in code, you can write statements that can duplicate "triggers". triggers
is just a term. No different that using query grid verses writing a sql
statement in vb code.
S.L.,

I was taling about Access as an MDB file. A Trigger
feature in Access would be a great enhancement - maybe
some day .... Thanks for your input.

B.
-----Original Message-----
Are you talking about an Access database, with a MDB
file, or about Access
as a Front-End with SQL-Server as the Back-End?

In the first case, the answer is no and for the second,
there is no
difference on the SQL-Server side about triggers when
Access is used as the
FE.

S. L.

Friends,

In SQL Server, I can set a Trigger that will
automatically
respond to data inserted into Table_A,[Field_1] by
inserting that same data into Table_B,[Field_1].

Is there any way to accomplish this same effect in
Access,
independent of forms/reports (and Code-Behind-Forms)?

Thanks,

Bill


.
 
J

JIMMIE WHITAKER

I see your point now. Is sql server the only system that uses triggers?
Douglas J. Steele said:
You're missing the point.

There is no way in Access to guarantee that code is automatically run when
you insert data into a table. Sure, you can run any code you want in your
application, but remember that anyone can link to your database and insert
data into your table without using your interface, thereby bypassing
whatever code you want run. Yes, you can check after the fact and run your
code, but if it was to prevent specific data from being entered, or to
ensure that additional data was inserted into another table, your code may
be too late to be effective.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



JIMMIE WHITAKER said:
Actually there is, by runing a function if the id number or whatever indexed
number is larger. Some before update and after update takes care of this.
You just need the if or case statements to decide what to do. A trigger is
nothing more than a flag. I have some on delete code that cleans up linked
tables. If you can say true or false, you can write code to do something
based on an action. I wish these modern people would quit coming up
with
so
many new buzz words. A trigger is nothing more than :

If myflag = 0 then put your hands on your head
OR
If myflag = 0 call myfunctiondeletethedangrecord
OR
just about anything you want if this flag you set up is 0.

heck, you could send a rocket to the moon in code if this flag is 0.
WHATEVER.

Douglas J. Steele said:
While you're right that a trigger is just code, triggers run automatically
when you insert data into a table, for instance. There's no way to
make
code
run automatically in Access when you insert data into a table.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



in code, you can write statements that can duplicate "triggers". triggers
is just a term. No different that using query grid verses writing a sql
statement in vb code.
S.L.,

I was taling about Access as an MDB file. A Trigger
feature in Access would be a great enhancement - maybe
some day .... Thanks for your input.

B.
-----Original Message-----
Are you talking about an Access database, with a MDB
file, or about Access
as a Front-End with SQL-Server as the Back-End?

In the first case, the answer is no and for the second,
there is no
difference on the SQL-Server side about triggers when
Access is used as the
FE.

S. L.

Friends,

In SQL Server, I can set a Trigger that will
automatically
respond to data inserted into Table_A,[Field_1] by
inserting that same data into Table_B,[Field_1].

Is there any way to accomplish this same effect in
Access,
independent of forms/reports (and Code-Behind-Forms)?

Thanks,

Bill


.
 
D

Douglas J. Steele

I believe that most server-based DBMS have triggers. AFAIK, Oracle and DB2
both do.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



JIMMIE WHITAKER said:
I see your point now. Is sql server the only system that uses triggers?
Douglas J. Steele said:
You're missing the point.

There is no way in Access to guarantee that code is automatically run when
you insert data into a table. Sure, you can run any code you want in your
application, but remember that anyone can link to your database and insert
data into your table without using your interface, thereby bypassing
whatever code you want run. Yes, you can check after the fact and run your
code, but if it was to prevent specific data from being entered, or to
ensure that additional data was inserted into another table, your code may
be too late to be effective.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



JIMMIE WHITAKER said:
Actually there is, by runing a function if the id number or whatever indexed
number is larger. Some before update and after update takes care of this.
You just need the if or case statements to decide what to do. A
trigger
is
nothing more than a flag. I have some on delete code that cleans up linked
tables. If you can say true or false, you can write code to do something
based on an action. I wish these modern people would quit coming up
with
so
many new buzz words. A trigger is nothing more than :

If myflag = 0 then put your hands on your head
OR
If myflag = 0 call myfunctiondeletethedangrecord
OR
just about anything you want if this flag you set up is 0.

heck, you could send a rocket to the moon in code if this flag is 0.
WHATEVER.

While you're right that a trigger is just code, triggers run automatically
when you insert data into a table, for instance. There's no way to make
code
run automatically in Access when you insert data into a table.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



in code, you can write statements that can duplicate "triggers".
triggers
is just a term. No different that using query grid verses writing
a
sql
statement in vb code.
S.L.,

I was taling about Access as an MDB file. A Trigger
feature in Access would be a great enhancement - maybe
some day .... Thanks for your input.

B.
-----Original Message-----
Are you talking about an Access database, with a MDB
file, or about Access
as a Front-End with SQL-Server as the Back-End?

In the first case, the answer is no and for the second,
there is no
difference on the SQL-Server side about triggers when
Access is used as the
FE.

S. L.

Friends,

In SQL Server, I can set a Trigger that will
automatically
respond to data inserted into Table_A,[Field_1] by
inserting that same data into Table_B,[Field_1].

Is there any way to accomplish this same effect in
Access,
independent of forms/reports (and Code-Behind-Forms)?

Thanks,

Bill


.
 

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