CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 update record in different table

Print topic Send  topic

Author Message
tumby1974

Posts: 26
Posted: 09/26/2012, 8:05 AM

If I'm working on a page with record with data from table A, i'd also like to update a field in table B that is kinda related.

I'd like it to update when I update the record for table A (leave the page), so it's hidden behind the scenes.

ex.
when page comes up
Record with data from TABLE A

(hidden code for setting field in TABLE B to -1)

hit "update" or "add" for record, and table A updates with its changes, and table B updates with the hidden change.

both tables can be related via an ID field.

I don't know where to start working on this.
View profile  Send private message
mljonzs

Posts: 124
Posted: 09/26/2012, 8:15 AM

Sounds like the easiest thing for you to do is to put your code to update Table B's field into the AfterExecuteUpdate method for the record containing Table A

Or, you might be able to do it by creating an updatable view that has both tables joined together properly and then add code into the BeforeExecuteUpdate method of the record to set the value associated with the field from Table B.


_________________
What does not begin WITH God, will end in failure!
View profile  Send private message
tumby1974

Posts: 26
Posted: 09/26/2012, 8:49 AM

ok, thanks!

so, for option 1.....

use SQL code in AfterExecuteUpdate to pull up table B record (that uses the same ID as table A) and change the field I want to -1.

the only thing I've used is ccdlookup in the code section. Would this be similar to using CCDLookup?

View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.