Jump to content

Lock Field Contents After Text Entry


This topic is 7010 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

"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. wink.gif

Link to comment
Share on other sites

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!!! grin.gif

LaRetta

Link to comment
Share on other sites

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... badidea.gif

Link to comment
Share on other sites

Hi Vaughan smile.gif

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. yep.gif

LaRetta

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 7010 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.