Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Linking values from table 1 to table 2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Linking values from table 1 to table 2

    What is the correct mechanism to transfer a value from a field with a drop down list in table 1 to a linked field in table 2?

    For example: table 1 has a field called "Coats". The choices are: winter, fall, spring. Table 2 is linked 1 to many with drop down list of Red, Blue, Green, etc. How do you isolate the input form in table 2 so all of the records only apply to a choice selection from the table 1 drop down? I want to be able to input 50 - 100 records at a time that only apply to 1 choice from the table 1 drop down list. Then to be able to select a different choice from the table 1 drop down, and input 50 - 100 records into the form in table 2 that apply to that choice.

    Appreciate any help you can give me.
    Tom

    #2
    RE: Linking values from table 1 to table 2

    Sorry...the linked fields are Coats (the dropdown in table1) to Coates2(a field in table2). The dropdown field in table2 is not linked.

    Thanks,
    Tom

    Comment


      #3
      RE: Linking values from table 1 to table 2

      Tom, to me the answer to this turns on how you are doing your data entry.

      For example, if you are using a form based on the set, with an embedded browse for the child table, values will be inserted into the linking field of each child record automatically, by Alpha Five.

      On the other hand, if your child records are being entered using a separate form (based on the child table) called from an earlier form in which the user entered a new "parent" record, you must pass the key value from the first form to the second, and then insert it into the linking field for the user. This is my own preferred data entry routine by the way. You can pass the value by saving it in a global variable in the first form, then declaring and using the global variable in the second form. Or, you can have the second form retrieve the value from the first form, assuming it will *always* be there at run time. In any case, the field in the second form should be set read only, so your user doesn't mess up the key value (which of course is needed to maintain the relationship with the parent table).

      Hope this helps. Let us know how things turn out.

      -- tom

      Comment


        #4
        RE: Linking values from table 1 to table 2

        Tom:

        Thanks very much for your help. Unfortunately, I'm still stuck. When you select a value from a choice list in drop down, is that value active as long as the form is open? If I have a button on the form that opens form 2 in table 2 what is the verbage on the button(action) to copy or fill that value to a field in form2?

        Thanks again,
        Tom S.

        Comment


          #5
          RE: Linking values from table 1 to table 2

          Tom,

          There are probably lots of ways to do it, but here's one.

          In the attached file you will find a database called Testing. Unzip it to its own folder.

          You will find that it contains two tables, Names and Addresses.

          It has one set, Names, linked one-to-many to Addresses.

          It's a fragment of an imaginary contact manager, in which you are trying to track multiple addresses (home, office, vacation get away, etc.) for each person.

          Open the Names form. Navigate through the records. There are only 2.

          Then push the button to "Call the Addresses form, begin new record, and pass ID".

          You will see the addresses form on screen, with the value of the field I want to use as my linking value filled in automatically.

          Here's how it works:

          1. The addresses form is the default form for the addresses table, except I've removed ID from the tab order and have made it read only. This prevents the user from being able to change a key value I need to link back to related parent records.

          2. The names form is the default form for the names table. I've added the button to call the Addresses form. This is where the heavy lifting is done.

          3. The onPush event of the button loads the addresses form; begins data entry; and passes the ID value to the ID field on the addresses form. Did not use any global variables. Just used the current value of the ID field from the Names table.

          Hope this helps.

          -- tom

          Comment


            #6
            RE: Linking values from table 1 to table 2

            Tom:
            I can't tell you how much I appreciate your help. That was a most thorough explanation. It works perfectly on navigating into form 2 and passing the value from one table to the next. Problem now is that when I press button on form 2 to enter new record, the value in the field which had been transferred, disappears.

            What do you think happened?

            Tom S.

            Comment


              #7
              RE: Linking values from table 1 to table 2

              The example I sent you simply passed the value from form1 to form2. It did it by placing the value in a specific field of the table upon which form2 was based - after beginning to enter a new record.

              When you begin entering a second record the old value is gone.

              One solution to this would be to store the value in a variable attached to form2, and then place the value of that variable in the designated field each time you begin entering a new record. It could behave sort of like default field values, if you see what I mean.

              -- tom

              Comment


                #8
                RE: Linking values from table 1 to table 2

                I reworked the earlier forms to permit one to enter multiple addresses consecutively, for a single name. Instead of passing the key value directly to a field in the called table, I store it in a global variable, and then read the global variable from the called form every time a new record is entered. Here are the details.

                The attached file should be unzipped into its own folder.

                I made no changes in the tables or indexes.

                On the Names form, I modified the script which runs when the button is pushed to call the addresses form, begin a new record, and pass the id value. The value of the current id is first stored in a global variable called idnumber. Then the addresses form is called, and a new record is started. The script no longer stuff the id value into a field in the addresses table. It just stores the value in a global variable.

                In the Addresses form a number of changes were made.

                Save Button - it no longer closes the form, it just saves the pending changes.
                Cancel Button - it no longer closes the form, it just saves the pending changes.
                Close Button - this is new. It closes the form, but only when there are no changes pending.
                New Record Button - this is new. It causes the form to enter a new record, but only when there are no changes pending.

                The OnEnter event for the Addresses form now contains a new script. This script declares a global variable with the same name as that declared in the Names form. This causes the Addresses form to be able to "see" the value of the global variable that was set back in the names form, when the button was pushed to enter a new address. This value is then assigned to the ID field in the Addresses form, and the field is refreshed, causing the display to show the actual value. Because this script runs every time the form enters a new record, it will run each time the user pushes the New Record Button. Remember, the id field in the Addresses form is "read only" so the user can't destroy the link between the current address record and the name in the parent record back in the names table.

                Pretty nifty, isn't it?

                -- tom

                Comment


                  #9
                  RE: Linking values from table 1 to table 2

                  Tom:

                  Thanks a million for all your help with this. Can't tell you how much I appreciate it.

                  I finally got it to work using your first explanation. The field value was getting transferred to the form in the 2nd table ok, but came up blank when I entered a new record in the child table. I changed the field rule for default mode to: use previous value as default, and it works fine.

                  You guys are really great. Thanks again,

                  Tom

                  Comment

                  Working...
                  X