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

Browse Child Challenge

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

    #16
    RE: Browse Child Challenge

    Did not know that, either! Will take a look. thanks!


    -- tom

    Comment


      #17
      RE: Browse Child Challenge

      Neat!

      Thanks.

      -- tom

      Comment


        #18
        RE: Browse Child Challenge

        Hi Tom:

        " how would you 'release' the query if the user wanted to go back and 'show all' the child table records?"

        Yes, I'd have a query that would include all child records (see attached). We have an analagous situation in our billing screen where we need to filter child records in different ways on the same form.

        We do it with a combination of a multi-state button and conditional objects. Our script runs in the OnChange of the MS Button. So I cheated, having done this before!

        Finian
        Finian

        Comment


          #19
          RE: Browse Child Challenge

          Hi All,

          Like everyone else I'm grateful to Tom for posing the challenge.

          There would seem to be little to add but I thought I would supply a specimen which uses this technique in a login context with user input captured by a dialog form.

          Run the little startup scrip from the code tab. You get a dialog form where you can enter start and end dates for the invoices and also select a member name. The query is run on the member (in the parent table) as well as the invoices. (Normally, Finian's show all button would not be there but I left it for convenience.)

          I use this technique in an application where I need to filter not only for a range of courses in the child but also want the user to only see (and be able to edit) the courses belonging to their own department. Like the members, each department has a name and and id number so the problem is similar.

          Hope this is not too basic for everyone. I really enjoyed seeing everybody's work. Thanks

          Bill
          Bill Hanigsberg

          Comment


            #20
            RE: Browse Child Challenge

            Thanks. Me, too! It's great to see how folks solve these problems. So far we've identified four distinct ways to filter and display records from a child table:


            1) Invert the set, build the form on the inverted set, filter on the child table since it's now the parent...


            2) Build the form on the parent table alone. Call a second form after getting the filter range criteria from the user. Base the second form on the child table, standing alone, include a browse object to view the records, and filter the form to show only those records meeting the range criteria.


            3) Base the form on the original set. Embed a filter in the properties of the form which shows some or all of the child table records depending on the value of a variable set by the user. (Jeff's approach)


            4) Base the form on the original set. Get pointer to the form, and use that to set a filter expression for the child table. Run a query against the child table, using the form pointer reference. (Finian's approach)


            Importantly, I've learned also that if the field used in setting the range of desired records is also used to set the order of the displayed child table records in the link expression used in the set...(boy that's a mouthful!)... then methods 3 & 4 won't work. The link expression 'trumps' the effort to filter the child table records further.


            My thanks to all who 'took the challenge'!


            -- tom

            Comment


              #21
              RE: Browse Child Challenge

              Thank you Tom!
              - this has been an excellent excercise. I didn't get mine done too fast except I did find the method... I copied everyones answers into their own directory, and everyone has something to offer.

              -now THIS is what I call a code archive. Simple? Not at all - look at all the variations. Educational? Extremely.

              From time to time I hope we have some more posts like this!

              Again - thank you Tom.

              Steve Williams

              Comment


                #22
                RE: Browse Child Challenge

                This is just curiousity on my part, but if anyone has any ideas I'd be interested. I took a parent table with 80,000 records and a child table with 60,000 records, made a set with a single linking field and used Finian's exact code just changing some field names. I additionally created an index tag using the field name of my date field as existed in Finian's test. One of my parent records had about 9,000 child records. FINIAN'S CODE WORKED EXTREMELY WELL. The initial filter button took a little while and scrolling into the parent with 9,000 child records also took a little while. The interesting thing to me was when I erased the index with the date, the two events took about half the time. Part of the query code was:

                frm:Tables:transactions.order_expression="Transdate"

                When I had an index tag with that name the query ran slower than when I did not have an index tag with that name. I know that this line of code uses the index if it exists rather than the field name to order by, but I wonder why it is slower to run the query when the index exists.

                This won;t keep me awake at night but I am curious.










                Comment


                  #23
                  RE: Browse Child Challenge

                  Hello Finian,

                  Could I ask for a bit of your philosophy here?
                  Why did you do a form.find() toward the end of your script? I'm assuming you were making sure that you remained on the same parent record, but why, have you seen problems with this? Also, why the field.show() line in the script?

                  Thanks,
                  Jim

                  Comment


                    #24
                    RE: Browse Child Challenge

                    Tom,

                    I had an idea but unfortunately, A5 isn't up to the task. My thought was to create a browse. Then create a query on the browse using query by table. The query would prompt for the begin and end dates. Back on the form, create a button (using the button genie) that would call up the query and the browse. I do this in Access 97 but unfortunately A5 only shows the queries associated with the form or table on which the button was created. A97 shows all queries. If A5 did this, it would be a big help!!!

                    Also tried creating a query with the Operation tab but ran into a brick wall there as well.

                    This method would have been an easy way to do it w/o writing code.

                    kenn
                    TYVM :) kenn

                    Knowing what you can achieve will not become reality until you imagine and explore.

                    Comment


                      #25
                      RE: Browse Child Challenge

                      Ken, here's one way to do what you are talking about, without using query by table.


                      This approach uses two forms. The first form displays records in the 'parent' table. The user sets the date range in variables on the form. A button is used to open a second form which contains the browse into the 'child' table.


                      -- tom

                      Comment


                        #26
                        RE: Browse Child Challenge

                        I've extended the 'UseSecondForm' approach to show another way to do it. This time the button runs an operation and which calls the default browse for the Transactions table. This presents the desired view of the related 'child' table records. I think this may be even closer to what you had in mind.


                        -- tom

                        Comment


                          #27
                          RE: Browse Child Challenge

                          Hi John:

                          I really don't have any idea why this should be the case. Certainly it's not what I would have expected.

                          Just curious, does it make any idea how the index is defined? For example, if you change the def. to CDATE(Transdate)?

                          Finian
                          Finian

                          Comment


                            #28
                            RE: Browse Child Challenge

                            Bill, thanks for your contribution to this 'open source' project!


                            I was interested to see your startup script actually runs two separate queries against the tables in the set. One against the parent, and one against the child. I had always presumed one must do this in a single, more complex, query against both at once. Your approach is *much* easier to read and understand.


                            It's also interesting to me that your script works fine even if the variables vBdate and vEdate are *not* global. This is worth noting since many of us try hard not to let them proliferate throughout our applications.


                            Thanks again.

                            -- tom

                            Comment


                              #29
                              RE: Browse Child Challenge

                              Finian,
                              Let me say again, this is no big deal. Your stuff produces the desired results. Using CDATE in the index did not change the results. Some very interesting things are going on between the table query that you do and Alpha's bringing records into the browse based on the parent link defined in the set. When the index exists, navigating from one parent to another causes alpha to do some kind of query, you can see it counting records, if there is at least one child record associated with the parent. Without the index existing, the only visible counting of records is when you navigate into the parent with a very large number of records.

                              John

                              Comment


                                #30
                                RE: Browse Child Challenge

                                Hi Again,

                                "It's also interesting to me that your script works fine even if the variables vBdate and vEdate are *not* global."

                                I realize this and the point is well taken. What I was "thinking" about is that in the application where I use this technique the analogs to vBdate and vEdate are tossed around among all the application's forms and thus must be global. In the demo there is only the one script so they can be local.

                                Let me reemphasize that the approach of two separate queries run sequentially on parent and child tables is taken directly from chap 29 of Peter Wayne's book.

                                All the best,
                                Bill
                                Bill Hanigsberg

                                Comment

                                Working...
                                X