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

Calling a New Form

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

    Calling a New Form

    I have a button on a form (Form 1) that when pushed is supposed to call another form (Form 2) and open a new record within Form 2. I used action scripting to create the button and my script is as follows:

    1. Get values into variables from existing form to pass to new form
    2. Open new from (Form 2)
    3. Activate new form (Form 2)
    4. Enter new record (From 2)


    After this I want to copy some of the fields in Form 2 and save before the user has a chance to make any changes. Form 2 is based on a set that has parent table (Table 1) and a one-to-one linked child table (Table 2). The fields that I am trying to copy are in Table 2 of Form 2 and are auto-incremented fields and calculated fields. No matter what I have tried, I can't get any of the fields in Table 2 to auto-increment or calculate until I physical mouse click into any field that is part of Table 2. I have tried this in several ways:

    1. Adding to the end of the script above to Activate an Object on Form 2 that is part of Table 2.
    2. Similar type Activate Scripts within the OnFetch, OnEnter, and OnActivate events of the form.

    No matter which way I have tried, I can not give focus to any fields in Table 2. Is there another way?

    Thanks in advance for any help you can provide.

    Doug

    #2
    RE: Calling a New Form

    Doug,

    You might try saving the form right after you open it. this should capture the autoincrement fields. As to the calculated fields, that depends on the calculation.

    Then, entry in the new form would be done in change mode rather than enter mode.

    Pat
    Pat Bremkamp
    MindKicks Consulting

    Comment


      #3
      RE: Calling a New Form

      Thank you for the reply. I tried that but it didn't work. I think it has something to do with the fact that the fields I am ultimately trying to fill is the link between Table 1 and Table 2. I am trying to make a new po. Table 2 is the po table and has the auto-incrementing field that determines the "po number" field, which is the field that is used to link to Table 1. I had this working when I just auto-incremented the po field itself, and had the Referential Integrety set to "None". I then copied the po to the linking field in Table 1. This worked fine until I tried adding a delete function and then needed to change the Referential Integrity to "Cascading". Now I can no longer auto-increment the po field and need to find a different way to get the po number. I am doing this by adding a "po_auto_incrementing" field and then trying to copy it to the two linking fields. Problem is that I can't do this until Table 2 in the new record auto-increments.

      Does this give you any other ideas.

      Thanks again,
      Doug

      Comment


        #4
        RE: Calling a New Form

        Doug,

        If you have a two table set, and you do data entry through a form based on that set, Alpha Five will automatically supply the link field value to each new child table record. It sounds to me as though you are trying to create that link field value using a field rule (auto increment), this would be a mistake. The autoincrement field rule is table based, not set based. If both the primary table and the linked child table independently use the autoincrment field rule to establish the link field value you're headed for trouble. -- tom

        Comment


          #5
          RE: Calling a New Form

          Doug, I would recommend you use the parent set to create the PO "header" first and then add the line items. You can use a button to start entry in Table1 using autoincrement and send focus to the line items. I would probably tell the button to save the header first, but A5 may do that automatically.

          Bob

          Comment


            #6
            RE: Calling a New Form

            I understand, which is why I am not trying to auto-increment the link field, but a separate dumby field that I can then copy into the link field in the parent table, which will then pass it to the link field in the child table. My problem is the auto-increment field has to come out of the child table, because the parent table could have other entries that would not originate from the same child table. As a result, all I need to do is get the auto-incremented dumby field copied into the parent table link field and saved before the user has a chance to cancel things before the link fields are filled. I want to do this with a button from Form 1 that calls a new record, based on my two table set in Form 2. I just don't know how to. Can you help?

            Thanks - Doug

            Comment


              #7
              RE: Calling a New Form

              Bob, Thanks for your reply, but I don't understand what you mean. I think you are saying to only start with Table 1 or parent table and then add the items from the child table. My only problem is that I need to autoincrement from the child table.

              What I really need to know how to do is to call form 2 from form 1 using a button. Form 2 has two tables with a one-to-one link. I need to be able to assign focus to a field in table two with the button. The standard Activate Object command in action scripting won't work for any field in the child table.

              I hope this explains better.

              Thanks - Doug

              Comment


                #8
                RE: Calling a New Form



                Doug Gels wrote:
                -------------------------------
                Bob, Thanks for your reply, but I don't understand what you mean. I think you are saying to only start with Table 1 or parent table and then add the items from the child table. My only problem is that I need to autoincrement from the child table.

                I don't understand why that statement is true. I don't think the others that have replied understand why either. Can you help us understand? Usually the parent record and id are created and then the child records are created with the linkage field filled by the set. Since a child record won't be created without a parent record, why does the child have to drive this process?

                What I really need to know how to do is to call form 2 from form 1 using a button. Form 2 has two tables with a one-to-one link. I need to be able to assign focus to a field in table two with the button. The standard Activate Object command in action scripting won't work for any field in the child table.

                I hope this explains better.

                Thanks - Doug
                Al Buchholz
                Bookwood Systems, LTD
                Weekly QReportBuilder Webinars Thursday 1 pm CST

                Occam's Razor - KISS
                Normalize till it hurts - De-normalize till it works.
                Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                When we triage a problem it is much easier to read sample systems than to read a mind.
                "Make it as simple as possible, but not simpler."
                Albert Einstein

                http://www.iadn.com/images/media/iadn_member.png

                Comment


                  #9
                  RE: Calling a New Form

                  The database I am trying to create is a tracking system for facility. We are a plastic recycler, and we conduct business in many forms: brokering deals for material that never reach our facility, toll processing for customers in which we don't buy material and only provide a service, and buying material, processing it, and selling to a different end user are just a few but the most common. Since every deal is different, I needed a way to keep track of everything (i.e. - po's, sales orders, shipments, etc.). The system/database I a trying to create is to have a main "Job" to which I can add as many po's, shipments etc. to it that I need. In the overall scheme, I have the the topparent table named "Job". Under it I have "Job Items" of which will be the po's, shipments, sales order, etc.

                  In my previous messages, my Form 1 is based on a set that has Job as the parent and Job Items as a one-to-many link. On Form 1, I have added a button that is labeled "Add PO" (ultimately I will have other buttons on Form 1 called "Add Shipment", "Add Sales Order", etc). What I want this button to do is to call Form 2 which is a set that has Job Items as its parent and my PO table as one-to-one child link. If I auto-increment from "Job Items" (the parent), I will increment with each "Item" whether it is a shipment, po, or sales order. My PO numbers will not be sequential, which will make very hard for me to determine when one has been lost or misused. So I want to auto-increment from the PO Table so that they are sequential. I hope this explains it well enough. This is not "set in stone" either. If there is a better way, I am open for suggestions.

                  Thanks for your time.
                  Doug

                  Comment


                    #10
                    RE: Calling a New Form

                    "i"I don't understand why that statement is true. I don't think the others that have replied understand why either. Can you help us understand?"/i"

                    True... after I posted I realized you said a one to one link and that tells me something different is going on than I thought. So, Table2 is a PO table, correct? what is table1?

                    The "B"linking"/B" field in this set cannot be an autoincrement child field because the parent will determine the child record's linking field whether you like it or not. That's the way sets work.

                    You "b"can"/B" have a non-linked child-field autoincrement and fill a non-linked parent-field using the OnSave event "i"or"/I" you can create a new set with Table2 as the parent and Table1 as the child, then use the Copy to function to copy your PO form to the new table.

                    Not sure if this will accomplish what you want, but we'll keep trying.

                    Bob

                    Comment


                      #11
                      RE: Calling a New Form

                      So, Table2 is a PO table, correct? what is table1? Table 1 is my Job Items table.

                      The second part of your email about making switching the parent a child tables makes sense. Since they are a one to one link, I can't think of why I couldn't switch them.

                      Thanks for all your time. I just needed someone to help me think outside the box. Its late and I'm off to bed. I will try it in the morning.

                      Thanks again,

                      Doug

                      Comment


                        #12
                        RE: Calling a New Form

                        No problem... let us know how it goes.

                        You can have differently structured sets referring to the same tables. This comes in "b"very"/B" handy when you get into designing reports.

                        Just remember to save your work frequently, make backups frequently and do database maintenance semi-frequently. (update indexes, pack, compact)

                        regards,
                        Bob

                        Comment


                          #13
                          RE: Calling a New Form

                          Doug, I am very new to Alpha5 so the more experienced users on this forum will tell us if these ideas will work or not.

                          You could have in the 'Job Items' table a seperate incrementing field for each Job Item type (PO, sales order, shipment, etc) When the button on form1, which would be unique to the type of job item you want to create calls Form2 it would increment the appropriate field. The fields could be in the form of PO-1234, SO-1234, SH-1234.

                          Then, still in the 'Job Items' table, copy that field to the field you use as the linking field to the actual item table. When you create the child record in the PO table through form2 it will have a PO-1234 number.

                          While writing the above I also thought why not just let the 'Job Items' have one incrementing field which will be the linking field for whatever child tables attatch to it. As you say the Numbers in your various item tables would be out of order but you would only use this field in the child tables to link to the parent, 'Job Items' This field you would not have to show on any forms. Have a seperate autoincrementing field in your individual child tables (eg PO table) that would serve as the PO number. This field would be shown on your forms. Another benefit to this would be that you could create a PO from a completely different part of your system. The PO numbers would be consecutive while being independent from the Jobs table and the Job Items table.


                          These ideas may be way of the mark. I offer them in case they help in some way and so that i might learn from any feed back as well.



                          Regards, Tim
                          Tim Kiebert
                          Eagle Creek Citrus
                          A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                          Comment

                          Working...
                          X