This topic is locked

Insert A Record Into Another Table

2/12/2007 9:54:25 PM
ASPRunnerPro General questions
G
Greg Cantwell author

I want to be able to change the group member field after an edit has been saved.

I understand that it may be in the events tab...

I need the actual language....I'm a total neophyte when it comes to this stuff
I am using MS Access

My logins are in a separate Table named Logons
Fields are:
Org ID

Password

GroupID
The intent is to allow access to a different product (via the group ID) after the 1st product has been added to the record.
Thanks in advance

J
Jane 2/13/2007

Greg,
you can do it using events.

Proceed to the Events tab, select Before record updated event and add your code in it.

Here is a sample code:

Function BeforeAdd(dict)

strUpdate = "update Logons set GroupID='new value' where OrgID=" & dict("FieldName")

dbConnection.Execute strUpdate
BeforeAdd = True
End Function



where FieldName is your actual table name in the main table.

G
Greg Cantwell author 2/13/2007

I couldn't seem to get that to work..it didn't change the field
I have 2 tables
one with contact info and organizational info named YIRDB

YIRDB contains all of the info that is being edited / added to using asprunner
and the other table is called "Logons"
Logons contain the organization ID, Password & GroupID
I want to change the Group ID in Logons from Teacher to Teachers2
thanks for your patience

Greg,

you can do it using events.

Proceed to the Events tab, select Before record updated event and add your code in it.

Here is a sample code:
where FieldName is your actual table name in the main table.

J
Jane 2/15/2007

Greg,
sorry for my fault. Here is the correct code:

Function BeforeEdit(dict, where)

strUpdate = "update Logons set GroupID='new value' where OrgID=" & dict("FieldName")

dbConnection.Execute strUpdate
BeforeEdit = True
End Function