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

Inserting data from one form into multiple tables

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

    Inserting data from one form into multiple tables

    I'd like to use one form to insert data into several tables. I have gone through several screens and I don't have the ability to change the table. I'm not trying to create duplicate information. Just want one part of the form to insert to table x and another part of the form to insert to table y.

    Any thoughts?

    Many thanks

    Page

    #2
    RE: Inserting data from one form into multiple tab

    Create a One-To-One set and base the form on that set. The will probably get you started.
    Aaron Brown
    Alpha Software Development Team

    Comment


      #3
      RE: Inserting data from one form into multiple tab

      Page:
      use the following xbasic, it's rather very simple:
      Say you want the value in Field1 in your current form to be copied to FiledA in tableA and Field2 to be copied to FiledB in tableB
      t=table.open("TableA")
      t.Change_begin()
      t.fieldA=field!
      t.change_end()
      repeat the above for TableB
      You are done
      Gabe

      Comment


        #4
        RE: Inserting data from one form into multiple tab

        Gabe,
        Do I add this code in the xbasic form editor?

        Many thanks
        Page

        Comment


          #5
          RE: Inserting data from one form into multiple tab

          Page:
          I am not sure what do you mean by the "Form editor", do you mean a form in design mode?
          You could attach this xbasic, say to a button on your form to the Onpush event. When you press that button, the script will execute.
          Gabe

          Comment


            #6
            RE: Inserting data from one form into multiple tab

            ok, I will try that. Many thanks.

            Comment


              #7
              RE: Inserting data from one form into multiple tab

              Gabe,

              I think it's going to be a bit more complicated than that.

              field! is undefined. If this is supposed to be field1, then I think you have to either establish a pointer to the current table (to read the field value, as in tbl_ptr.field) or you have to get the "value" or "text" property from the field object displaying the field in the form (as in parentform:fieldobjectname.value).

              And, if you're changing a record in the external table, don't you have to navigate to it somehow?

              I wonder if Page is talking about "entering" a new record in the external tables?

              Maybe if she gives us a sample collection of tables we can whip something up for her. What she wants to do is not difficult as you correctly indicate. However, if she's a beginner she's going to need help deciding what "hook" to use in order to attach the script.

              -- t

              Comment


                #8
                RE: Inserting data from one form into multiple tab

                Tom:
                field! is a typo, I meant field1.
                Page indicates that she wants to, basically, update some fields in some external tables while she is in a form based on the current table.

                "..establish a pointer to the current table.." Good point: while she is in the current table there is no need for pointers, unless, if that field is not an object on the form.
                When you enter:
                t.fieldA=field1 fieldA from TableA will take the value of field1 if it is an object on form of the current table. If it is not an object on the form, then you are right, she will need either to add it to the form as an object or use a pointer as you indicated.

                I had assumed, I suppose safely so, that those fields are objects on the form, else how would you know what are you updating ?! But then again, who knows !

                table.open("") will establish the pointer to the external table.

                Actually I run simillar routines in my DB, it works flawlessly with that simple routine!!
                Gabe

                Comment


                  #9
                  RE: Inserting data from one form into multiple tab

                  Gabe,

                  Are you saying that if Field1 is the name of a field object on her form you can pass it's 'value' to the other table using

                  t.fieldA = Field1

                  ???

                  If so, this is news to me, and I stand corrected. I thought it had to be

                  t.fieldA = parentform:Field1.value


                  -- t

                  Comment


                    #10
                    RE: Inserting data from one form into multiple tab

                    Yep. give it a try!
                    In fact, it does not have to be an object on the form !! so long as you are in the current form (and thus in the current table) when you make a reference to a field name, alpha will accept that as a name of a field in the current table. In which case if Page is in a form and makes references to field values of that table, the external tables will be updated accordinglly !!
                    To confirm my theory, I went and removed some objects from a form I have and the routine worked just fine !!
                    Gabe

                    Comment


                      #11
                      RE: Inserting data from one form into multiple tab

                      Gabe,

                      I cannot duplicate the handy technique you're describing.

                      Would you be good enough to post a simple example?

                      -- t

                      Comment


                        #12
                        RE: Inserting data from one form into multiple tab

                        Using a simple form, based on one table.
                        The form contains a field object called IdNum, which displays the current value of a character field called IdNum in the form's table. Curr_id is a local variable in each script.

                        This script works:
                        curr_id = parentform:IdNum.text
                        trace.writeln(curr_id)

                        This one does not:
                        curr_id = IdNum
                        trace.writeln(curr_id)

                        In the latter case Alpha reports that "Variable 'IdNum' can't be found". It doesn't recognize IdNum as a field in the table, or as an object name in the form.

                        -- t

                        Comment


                          #13
                          RE: Inserting data from one form into multiple tab

                          Tom:
                          Let's assume you named your table: "Test"
                          Try this:
                          curr_id = test-"IdNum

                          That's all there is to it!
                          Gabe

                          Comment


                            #14
                            RE: Inserting data from one form into multiple tab

                            Thanks, I see what you're talking about now.

                            So in the snippet for Page, it would be

                            table_name-"field1

                            right?

                            -- t

                            Comment


                              #15
                              RE: Inserting data from one form into multiple tab

                              Right! Oversight on my part. My apology! Page, Please take note.
                              Gabe

                              Comment

                              Working...
                              X