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

This should be simple calling one form from another, check for records & pass a value

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

    This should be simple calling one form from another, check for records & pass a value

    In the app I am developing I want to enter or search data from a main screen..If the data is not already in the file, I want to add a record to the main screen. Once done I want to add records to the child tables, and have set a toolbar to call those forms to deal with the details. Like the main screen if the record exists I simply want to populate the form(s) with existing data. If the record does not exist I want to add a new record to the child table forms (details). For my example I have a business (master) with applicant for details.

    To this point I have tried action scripts, but it only works is the data is in the child table, otherwise presents a no records found. I would like in the case to see and add new record with the primary key of the business table being loaded into the foreign key of the applicant (child table).

    Now admittedly I am new to Xbasic and confess I am still struggling with it. I have search the message board believing this must have been answered a thousand times but cannot locate a thread. I have searched the wiki but have not found the answer.

    I have looked at AlphaSports, but it appears they have a customer and new customer forms. It appears it uses more of a manual process.

    I have tried to code it in Xbasic but really have not come to grasp the way to reference controls on the various forms I have created. It appears you cannot reference objects until they are loaded memory. I would like to call the form and pass the value to it as it loads, as it returns whether or not there are matching records react accordingling.

    If there is a thread, or search words I should use, or a place to look in the wiki I would appreciate being pointed in the right direction.

    If I sound confused ... well I am ... I may have give up on A5 and go back to VB.Net. I am spending so much time searching for information I am getting little coding done. :(
    Regards,

    John W.
    www.CustomReportWriters.net

    #2
    Re: This should be simple calling one form from another, check for records & pass a v

    If you're working with native Alpha Five tables the examples in the Code Archive form might help. Look for a thread dealing with "pass values" to a form.

    -- tom

    Comment


      #3
      Re: This should be simple calling one form from another, check for records & pass a v

      Sounds like you need to get a handle on SETS.
      The Children will be populated using the key data at the parent level, then, you can open other forms and post data anywhere you want.
      Can we see an example John?
      See our Hybrid Option here;
      https://hybridapps.example-software.com/


      Apologies to anyone I haven't managed to upset yet.
      You are held in a queue and I will get to you soon.

      Comment


        #4
        Re: This should be simple calling one form from another, check for records & pass a v

        Tom

        Thanks for the response. I have read so many of your posts over the past several weeks as I having been trying to learn A5 that I feel I should know you.:)

        I have found that sample and downloaded it a couple of days ago. However, I cannot see the Xbasic code, when I try to look it gives me an error and cannot get past that. The app seems to run, so I imagine I must be doing something wrong. I am working with v10.5

        In addition to passing the values I need use that value to test for records in the detail table. If records exist ( the primary key is the value passed and is the foreign key in the detail table, so 'where fk= pk') then I need the form populated with existing record(s). If records do not exist then I need the form loaded, the foreign key value set to the value of the primary key from the callling form and set to new record mode.

        In VB.Net there are a number of ways to do this a very rough example

        Form 1 (code)
        buttion_onclick event -- a button is pushed
        form2.test(businessId. text) -- here I call the sub from form 2 and pass the value from the control


        Form 2
        formLoad (event)
        Test - here I run the sub as the form loads
        end

        Public Sub Test ( fk as integer)
        do work.... here is the sub that does the work and uses the passed value from Form 1.
        end sub

        I will assume there is an equally simple way to do this in A5 but I am so lost in the process I have not figurered it out.

        Again any help is appreciated.
        Regards,

        John W.
        www.CustomReportWriters.net

        Comment


          #5
          Re: This should be simple calling one form from another, check for records & pass a v

          Ted:

          I have db with a master table and a number of others serving as detail. I have tried to normalize the database within reason. I am building a licensing/permitting data system. The master shows the business or person be licensed or permitted. I then want to go to a details showing the applicant, and then details about the applicant. This applicant information, includes employment history details, criminal history details and represents its own set,but connected to the primary business set via a primary key - foreign relationship. All that is to say is that at this point I believe I have the sets correctly sorted out, but darned if I can these forms sorted out in getting them correctly wired together.

          Thanks again for taking the time to respond, I have appreciated your help so much over the past weeks.
          Regards,

          John W.
          www.CustomReportWriters.net

          Comment


            #6
            Re: This should be simple calling one form from another, check for records & pass a v

            John,

            I don't know why you can't see the code in the example.

            If you run the developer version of Alpha Five (not the runtime) you should be able to see all the code just fine.

            Here's a screencast showing you how to do that.

            Comment


              #7
              Re: This should be simple calling one form from another, check for records & pass a v

              John, example attached of one way to skin the cat.
              Pull it apart. No Sets, just created children if none exist.
              Attached Files
              See our Hybrid Option here;
              https://hybridapps.example-software.com/


              Apologies to anyone I haven't managed to upset yet.
              You are held in a queue and I will get to you soon.

              Comment


                #8
                Re: This should be simple calling one form from another, check for records & pass a v

                Tom:

                Rookie mistake made by an A5 rookie. Anyway I can now see the code, so I will give it a look and get back with any direct questions. My mistake was not opening it from within A5 developer. When I double clicked on the .adb it must have used the runtime as the default.

                Thanks again.
                Regards,

                John W.
                www.CustomReportWriters.net

                Comment


                  #9
                  Re: This should be simple calling one form from another, check for records & pass a v

                  John,

                  Thanks for explaining what happened, and yes, you were probably running the runtime. Most of us have done the same thing.

                  I don't recommend opening databases by double clicking the ADB file. Use the shortcut tool to put a shortcut on your desktop, or open the database from the File menu, instead. It will prove more reliable.

                  -- tom

                  Comment


                    #10
                    Re: This should be simple calling one form from another, check for records & pass a v

                    Ted

                    Thanks for taking the time to provide the sample code. I have downloadedi t and will start looking at it.

                    I dont know what I would do without the support of the forum.
                    Regards,

                    John W.
                    www.CustomReportWriters.net

                    Comment


                      #11
                      Re: This should be simple calling one form from another, check for records & pass a v

                      Tom/Ted:

                      I have done a quick scan of the code samples you each provided. Before I tell you what had me smile, I again wanted to thank you.

                      These are great samples and will be of real help. Anyway, what had me smiling, was that while both samples are exactly what I needed to move forward, they both used a different approach. One seemed to be pure xBasic and the other pure Action Scripting. The thing is both solutions work so darn well, now so how do I choose which to follow? I kind of feel like Dorothy on the yellow brick roard.

                      Lest anyone think there is only one way to solve an A5 issue...well they are wrong. This served as a good reminder to keep an open mind about the approach you use. Now what I need to do is see if I can blend these together for a bit of automation.

                      So the journey continues.
                      Regards,

                      John W.
                      www.CustomReportWriters.net

                      Comment


                        #12
                        Re: This should be simple calling one form from another, check for records & pass a v

                        You are most welcome. I avoid code - others love it.
                        See our Hybrid Option here;
                        https://hybridapps.example-software.com/


                        Apologies to anyone I haven't managed to upset yet.
                        You are held in a queue and I will get to you soon.

                        Comment


                          #13
                          Re: This should be simple calling one form from another, check for records & pass a v

                          Ted,

                          I chose xbasic in my examples because of limitations in action scripting at the time. It's come a long way and is much more flexible and useful now. However, action scripting doesn't answer the question posed here, because it conceals how to actually "address" objects in the form using code. I"d argue that this is a key concept to understand. The example I put together was intended to be a teaching tool as much as anything else.

                          -- tom

                          -- tom

                          Comment


                            #14
                            Re: This should be simple calling one form from another, check for records & pass a v

                            I wasn't competing with you Tom, it's just that sometimes a body just wants to get something working easily and quickly.
                            You are absolutely correct about the learning, so I will download the code and see if I can understand it - comments and all!
                            See our Hybrid Option here;
                            https://hybridapps.example-software.com/


                            Apologies to anyone I haven't managed to upset yet.
                            You are held in a queue and I will get to you soon.

                            Comment


                              #15
                              Re: This should be simple calling one form from another, check for records & pass a v

                              Thanks, Ted,

                              I get touchy and cranky when I get hungry and there were no Snickers bars at hand! Sorry 'bout that.

                              -- tom

                              Comment

                              Working...
                              X