Frink1234 Posted February 6, 2005 Posted February 6, 2005 I'm trying to devise a script for a button that would "lock" the contents of a text field and prevent the user from editing the contents after the text had been entered. The field starts out blank, text is entered and then clicking the button will make it unalterable.
RalphL Posted February 6, 2005 Posted February 6, 2005 Take at look at this for starters: http://www.fmforums.com/threads/showflat...true#Post144687
Frink1234 Posted February 6, 2005 Author Posted February 6, 2005 Ok, I see. Thanks, that does get me started. Now, what I really want to do, is set this up in a portal so that each time I add text to the input box it is saved to a new line in the portal which is not modifiable. The input box is just a temporary holding place for the text until it is permanently stored. Does that make sense?
RalphL Posted February 6, 2005 Posted February 6, 2005 I assume that you are prohibiting editing in the field in the portal. Make your input box a global field also make global field to hold the value of the key field. When you chick on the button the global key field is set to the key field. You go to a layout for the related table. Create a new record, set the foreign key to the global key field and set the text field to the input box. Return to the original layout.
Frink1234 Posted February 6, 2005 Author Posted February 6, 2005 I assume that you are prohibiting editing in the field in the portal. Yes, that is exactly right. Can you please clarify what you mean by "Foreign Key". (I know you don't mean the one to my Volvo)
RalphL Posted February 6, 2005 Posted February 6, 2005 A record should have a key field which is called the primary key. When you make a relationship to another table the the field that you use in the relationship in that table is called the foreign key. It is the field in the related table that completes the relationship.
Vaughan Posted February 6, 2005 Posted February 6, 2005 "Can you please clarify what you mean by "Foreign Key". (I know you don't mean the one to my Volvo)" Ahh, see this is a real trap for novice database developers. You have forgotten to take localisation and relative file references into account. In Sweden, Volvos are *local* keys. A Chevy would be foreign.
LaRetta Posted February 6, 2005 Posted February 6, 2005 This really confused me when I was new and I think it could use further explanation ... The Foreign Key is determined by which side of the fence you are standing on. If you are in a main db and it has a Key field to a related file, that field is known as the Foreign key (while in your main database). If you jump to that related file, that same key field becomes your Primary key (in that related file). So a Foreign Key is always the key field which isn't native to the one you're in (not THAT table's unique ID key) and which relates to another file or table. Hi Vaughan!!! LaRetta
Vaughan Posted February 6, 2005 Posted February 6, 2005 Hi LaRetta You're always working on such interesting projects... those fingers of yours are always so busy! My post above was supposed to be funny...
LaRetta Posted February 6, 2005 Posted February 6, 2005 Hi Vaughan Your post WAS funny! I was attempting to reverse the logic (explain the 'localisation and relative file references') because that's where I got confused when new. If I'm in Sweden, my Volvo is my Primary and the Chevy my Foreign ... but if I then go to the US, that Chevy becomes my Primary!!! When first working with IDs, I would forget to switch my perspective as I moved from table to table and it can be very confusing. And in vs. 7, perspective is everything! Fingers busy? Yep, very. Now if I could only get my brain to go as fast as my fingers, I'd have it made. LaRetta
Frink1234 Posted February 7, 2005 Author Posted February 7, 2005 Well thank you Ralph, LaRetta and Vaughan for helping me. I can see I have my work cut out for me. I am new to this so I'll just take it slowly and hopefully I'll figure it all out. I really like the car analogy! I'm just not quite sure how many different fields I need in each location. I want to enter text into an input box (Field_Volvo) click a button and have the text erased from the input box and show-up on an uneditable line in a portal (Field_Chevy). This process should be infinitely repeatable adding successive lines to the Portal with each button click. Any more help? - Frink
Oldfogey Posted February 8, 2005 Posted February 8, 2005 I don't think Volvo drivers should be allowed to use FMP!
Vaughan Posted February 8, 2005 Posted February 8, 2005 Bloody FMP Developers! ON another list, in a galaxy far far away, a poster was ranting on about how ill-conceived and tasteless some car modifications were. "It's like putting a Toyota engine into a Lexus!" they cried.
RalphL Posted February 8, 2005 Posted February 8, 2005 Now that you understand primary and foreign keys, go back to my post outlining the method.
Vaughan Posted February 8, 2005 Posted February 8, 2005 I'm glad that Ralph has the presence of mind to stick to the topic and actually answer somebody's question!
Frink1234 Posted February 8, 2005 Author Posted February 8, 2005 I appreciate everyone's comments. They are all on topic as far as I can tell. Unfortunately, I still don't quite get it. Maybe Oldfogey is right?! No, I'm not giving in that easily. Do you mean I need to create a separate UniqueID field in addition to the input box? I wil restate my original goal: I want to enter text into an input box, click a button and have the text erased from the input box and show-up on an uneditable line in a portal. This process should be infinitely repeatable adding successive lines to the portal with each button click.
stanley Posted February 8, 2005 Posted February 8, 2005 Bloody FMP Developers! ON another list, in a galaxy far far away, a poster was ranting on about how ill-conceived and tasteless some car modifications were. "It's like putting a Toyota engine into a Lexus!" they cried. The funny thing about that being that a Lexus IS a Toyota, and therefore has a Toyota engine in it. -Stanley
RalphL Posted February 8, 2005 Posted February 8, 2005 I have made a sample file with 2 tables that does what you ask.
Frink1234 Posted February 9, 2005 Author Posted February 9, 2005 Thanks much, Ralph. I learn much better from example. I'll work on it a bit and if I have any other questions I think I know where to post them.
Recommended Posts
This topic is 7296 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now