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

Dynamically Change Form/Browse Source Table??

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

    Dynamically Change Form/Browse Source Table??

    Is it possible to change the source table for a form or browse from code? Assuming the alternate table has the same structure.

    For an embedded browse I tried:
    topparent:Browse1.Browse.Source_db = "Invoicedetails"
    but nothing happens.

    Thanks, Dan
    - Dan Hooley
    - Custom Desktop or Web database development -

    #2
    Re: Dynamically Change Form/Browse Source Table??

    Originally posted by dhooley View Post
    Is it possible to change the source table for a form or browse from code? Assuming the alternate table has the same structure.
    Yes and no. You can base a form or browse on a "shadow table" and redirect the shadow to point at multiple tables (one at a time, with the same structure).

    Originally posted by dhooley View Post
    For an embedded browse I tried:
    topparent:Browse1.Browse.Source_db = "Invoicedetails"
    but nothing happens.

    Thanks, Dan
    If you were working in visual basic the .Source_db property would be noted as read only.
    There can be only one.

    Comment


      #3
      Re: Dynamically Change Form/Browse Source Table??

      Stan, if the user is using a "shadowed" database, how would you accomplish this? since you would have to program for it in a full version, and most likely NOT on the Masterdatabase on the server, but one you would copy to the server after making changes, etc.. And also given that the form is based on a set - therefore the set would I guess also have to be based on shadow tables.
      Cole Custom Programming - Terrell, Texas
      972 524 8714
      [email protected]

      ____________________
      "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

      Comment


        #4
        Re: Dynamically Change Form/Browse Source Table??

        Originally posted by martinwcole View Post
        if the user is using a "shadowed" database, how would you accomplish this?
        I didn't say anything about a shadowed database. I said use a shadow table which is merely an alias for another table. You would alter the shadow table to refer to different real tables.

        There was something on the documentation main page at one time describing the technique. I'll take a look for it.

        The link doesn't seem to work any longer but the concept is referenced in a prior post.



        Richard Rabins
        Alpha Software Employee




        Real name: Richard Rabins
        Join Date: Sep 2000
        Posts: 1,391 new turbo demos in the learning center

        --------------------------------------------------------------------------------

        new Alpha Five Tutorials have been placed in the learning center section of www.alphasoftware.com


        http://www.alphasoftware.com/support...ningcenter.asp

        credit goes to Jim Chapman (who co edits the monthly newsletter with Bill Warner [email protected]) for doing a great job on these tutorials

        please direct feedback to Jim at [email protected]

        How to create a progressive lookup of values in an external table
        How to create a menu on a form using an underlying dummy table
        How to sort a child table on a report
        How to create a reverse set for reporting purposes
        How to use a Rich Text Object on a layout.
        How to create a script pick list using Action Scripting.
        How to manipulate a single shadow table. Useful for re-directing reports based on archived tables.
        How to manipulate shadow tables based on a set. Useful for re-directing reports based on archived sets.
        How to define a customized "Find By" routine.
        How to email a report.
        How to incorporate Alpha's built-in actions and routines in a user developed application.
        How to filter a browse based on a currently viewed record.
        How to use the pre-defined button genie in Action Scripting.
        How to use Action Scripting to run an external program.
        How to display information (related to what is currently displayed) from a different table.
        \0
        Last edited by Stan Mathews; 06-27-2008, 08:48 AM.
        There can be only one.

        Comment


          #5
          Re: Dynamically Change Form/Browse Source Table??

          The article I remember is supposed to be in the newsletter archives but I can't find a good link to them.
          There can be only one.

          Comment


            #6
            Re: Dynamically Change Form/Browse Source Table??

            Jim Chapman put an example in the code archive.

            http://msgboard.alphasoftware.com/al...t=shadow+table

            Jerry Gray

            Comment


              #7
              Re: Dynamically Change Form/Browse Source Table??

              I think TABLE.CREATE_SHADOW() is what you need. Do a search in the help file for "Shadow Table".

              Jerry Gray

              Comment


                #8
                Re: Dynamically Change Form/Browse Source Table??

                These are some interesting concepts!

                Now, do I have to use code to create the shadow table, or can I create it and have the browse base on it, and change the target? And how do I do that?

                Or how do I get the browse to point to the shadowed table?

                Dan
                - Dan Hooley
                - Custom Desktop or Web database development -

                Comment


                  #9
                  Re: Dynamically Change Form/Browse Source Table??

                  Assuming you have a series of tables to which you want to be able to switch the browse.
                  Use table.create_shadow() to create the shadow table.
                  Add the shadow table to your database.
                  Create the browse you want for this shadow table.
                  Use the second script in the pdf attachments to change the name of the table to which the shadow refers.
                  There can be only one.

                  Comment


                    #10
                    Re: Dynamically Change Form/Browse Source Table??

                    Another alternative would be to make copies of the browse, change the source table on each browse, and put each browse in a separate window of a conditional object.

                    If that will suit your purposes, it's probably the fastest and easiest way. It certainly beats the heck out of trying to reshadow a table (although that is a very clever technique, works well once it's set up, and I'm sure there are times when it's the best way).

                    Comment


                      #11
                      Re: Dynamically Change Form/Browse Source Table??

                      Have been playing around with it, but am having problems.

                      The table I am shadowing is part of a set. Does that make a difference? I can create the shadow, but it's not part of the set (and cannot be added), so isn't available to the form the browse is on.

                      Maybe shadowing is not the answer.

                      What I am trying to accomplish is to allow the child records in a one-to-many relationship to be edited and control when the changes are made permanent.

                      I was trying to accomplish this by having two identical child tables, one to hold the permanent data and the other to edit/add records and then the changes would be 'saved' to the permanent one, or discarded depending on user input. I only want the records for the current parent record in the 'edit/add' table, so as you scroll through the parent records, the 'edit/add' table needs to be emptied and then the correct ones added. I tried using the tbl.zap function to empty the edit/add table, but it needs exclusive read/write access, which is not available to a table that is part of a set. And if it is not a part of the set, it cannot be used in the browse. Does that make sense? Any ideas??

                      Dan
                      - Dan Hooley
                      - Custom Desktop or Web database development -

                      Comment


                        #12
                        Re: Dynamically Change Form/Browse Source Table??

                        Originally posted by dhooley View Post
                        The table I am shadowing is part of a set. Does that make a difference? I can create the shadow, but it's not part of the set (and cannot be added), so isn't available to the form the browse is on.
                        Yes it can. Download the sample in the link provided and take a look.
                        There can be only one.

                        Comment


                          #13
                          Re: Dynamically Change Form/Browse Source Table??

                          OK, well I got an error message and it wouldn't let me do it. I was working in the Alpha Sports sample database, so maybe there was something else going on.

                          Dan
                          - Dan Hooley
                          - Custom Desktop or Web database development -

                          Comment

                          Working...
                          X