January 30, 200323 yr I have a file that contains data on all employees and volunteers. I have a second file that is related through the field "ID No." (this number is established each time a new record is created in file number one). What I need is a script in file number one that will copy the ID No. and then open file number two and paste the ID No. into a new record there. Can anyone tell mne how to do this? Thanks,
January 30, 200323 yr Avoid Copy/Paste. Use a global and a constant relationship from a File 1 to File 2. In file A, create a field called gHook, set to be a global number field.Define this field to be =1 In the second file, create a field called cHook (stored calculation = 1). Create a relationship from File 1 to File 2 (call it Constant) Create a global field called g_ID (same format that your ID) in File 1 Then the script in File 1 should be. Browse Mode Set field g_ID (=IDN
August 15, 200322 yr Hi, I have same problem. Just want to get several things clear. 1. The constant relationship will be defined in 1st file, right? with gHook on the left and cHook on the right? Then How can you using this relationship in the 2nd file when you define the "Set ID" script? 2. I want put a button in 1st file to trigger the script. but what if the user click the button by mistake? then there will be an empty record(only has ID #) in 2nd file, right? I must miss something here. What's the trick? Thank in advance!
August 15, 200322 yr I think Ugo is on holiday so I'll try to answer this one... >>1. The constant relationship will be defined in 1st file, right? with gHook on the left and cHook on the right? >>Then How can you using this relationship in the 2nd file when you define the "Set ID" script? Actually the relation does not have to be valid if you only want to use a global field from another file. So you can just define a relation from file 2 to file 1 using gHook and cHook, or define g_ID in file 2 in stead of file 1 The second problem could be tackled by starting the script in file 1 with Show message "Are you sure you want to create a new record?" If Status(CurrentMessageChoice = 2) exit script end if Hope this helps. Ernst.
August 18, 200322 yr Thanks very much, Ernst. and sorry for my late reply. So there is no other more controlable way to handle the 2nd problem? I don't want use portal b/c the user doesn't like the whole screen blackout.
August 18, 200322 yr Presumably you will want more data in the related file than just the ID - otherwise there's not much point in having the record. I use a tachniwue to validate by script all the required fields. Try this and if the user cancels the routine then delete the record just created before you return to the main script in the master file.
Create an account or sign in to comment