Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to question

Status
Not open for further replies.

bv2000

Vendor
Nov 9, 2006
12
US
How would I write a script to do the following?
2 tables Table1 Table2
I want to enter information into Table1 and then take specific fields: Field1 Field2 Field3 and automatically enter the values of those fields into the corresponding fields in Table2.

Thank you in advance for any assistance
 
Several ways to go, it depend how your structure is.

A possible way to go:

Enter the data in table 1.
Put a button to trigger the script to push the new data in table 2, using the SetField() function.

Or, trigger the script to anter data in table one, put the script 'on hold' during data input in Table 1.
Resume script to push data in Table 2 with SetField().

 
Thanks for your info. I know that i use SetField, my problem is getting the exact form of the script for SetField to work. How would i write the script-
 
Several ways.

1. Push data in table 2 with a button in table 1.
SetField(Table2::Field1;Field1)
SetField(Table2::Field2;Field2)
SetField(Table2::Field3;Field3)

Put button in Table 1 with script attached.

2. Push data in table 2 with script in table 1.
Depend how you have to enter data in Table 1. Suppose it is in the 3 fields, starting at Field 1. Make field 1 a button with script attached:
Goto layout (yourLayout)
Goto Field (Table1::Field1)
Pause/Resume Script (Indefinitely)
SetField(Table2::Field1;Field1)
SetField(Table2::Field2;Field2)
SetField(Table2::Field3;Field3)
or
call the script above if you want to work modular.

During the pause time you can do what ever is needed, hit Enter to resume the script.

3. You can set 3 variables in a script and push the values into the fields in Table 2

4. You can do it without script. With a relationship and 3 lookup fields, triggered by the new values in the fields in Table 1.

 
5. With the plug-in on the FM CD to trigger a script when leaving the last field in Table 1.

6. With zipScript.

Don't know your structure, but if you have to stay in Table 1, I prefer the lookup way. You don't have to trigger a script (push button) and the data will have the latest version. Chances are the user 'forget' to push the button.
Unless you build in a way to prevent the user to leave the layout as long as he/she didn¿t click.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top