Connect Posted May 7, 2006 Share Posted May 7, 2006 I am creating a database for a small business whose previous data log consisted of complicated and redundant excel files. I am designing the database data entry layouts as a step-by-step series, so as to make it user-friendly (for the owner and also for members in case the business eventually wants to offer internet membership signup). All my tables are set up in one file. They consist of: Household Contacts Addresses Phones Emails CSAs Financial Status Payments The contacts/address/phone/email are in a different table so that the multiple ones can be associated with each household. CSA is a yearly membership, so Households can be considered a member, but select which year they participate in the small business. Currently I am working on the New Member data entry layout set. The Database opens to a layout on the CSA page, then to create a new member you click a button. This button will go to the Household table, create a record, then presumably begin in the Contacts table, creating a new record there. I am confused on how to write a successful script that will paste the Household ID created by creating a new record in Household into the Household ID field in the new record created in another table. So far I have tried Enter Browse Mode, Go to Layout [Household layout] New Record Request Copy [select, Household::Household ID] Go to Layout [Contacts] New Record Request Paste [select,Contacts::Household ID] Go to Field [first name] however it does not paste. I tried to paste instead into a field within the same layout (Household layout) but it still did not paste. Is this a paste restriction, or a copy restriction? For instance, is there a restriction on copying unique ID fields? If it's a paste problem, should I paste to a global field first or something? Are scripts written differently now that all tables are in the same file? In Pro 4 i used to have to open the file and then search the layout and field. Am i missing an identifying step that the script needs? How else can I automatically enter data into a new record created in a different table? When i am inside the same table, i just copy the record and clear other irrelevant fields. I could solve this problem by entering new records through portals set up in the Household table, but I am unfamiliar with how this works? thank you for your time and assistance! Quote Link to comment Share on other sites More sharing options...
Maarten Witberg Posted May 7, 2006 Share Posted May 7, 2006 If it's a paste problem, should I paste to a global field first or something? I think for copy-paste the fields must be present on the active layout, at least I was able to reproduce your issue that way. Nevertheless, what you could better do is to pass values using a global field and the set field [target field; value ] script step like this: Enter Browse Mode, Go to Layout [Household layout] New Record Request set field [globals::gTemp1; Household::Household ID] Go to Layout [Contacts] New Record Request Set Field [Contacts::Household ID; globals::gTemp1] Go to Field [first name] the method is more robust because 1) using copy-paste you might clear the clipboard memory of something the user has put there, and replace it with an ID he will be surprised or annoyed to see and 2) you can pass multiple values if you define more globals, this may come in handy and will save you a lot of script steps going back and forth between tables. The globals can be put into a separate, unrelated table (containing just 1 record). I could solve this problem by entering new records through portals set up in the Household table, but I am unfamiliar with how this works? Just check the "allow creation of related records in this table through this relationship" checkbox when defining the relationship. Clicking in the first empty portal row will then create a new record in the related table. maarten Quote Link to comment Share on other sites More sharing options...
LaRetta Posted May 8, 2006 Share Posted May 8, 2006 Script parameter can also be used to hold the value. smiley-smile Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.