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

Need to allow user to invoke "Show All"

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

    #16
    Forgot to attach the db...

    Comment


      #17
      Originally posted by Cheryl Lemire
      Wanda,

      You set the pointer as tbl
      Code:
      tbl = table.open("sites")
      so you would need to use tbl.query_create()
      Hi Cheryl,
      I tried that and have no clue why it doesn't work. It doesn't recognize the table that it opened or something like that...perhaps because the search button, itself, is on a form based on a different table. What do you think?
      Thank you,
      Wanda

      Comment


        #18
        Wanda, your form does not have a filter expression embedded in the layout. Hence, my previous suggestion will not work.

        You're using :form.viewqueried() to both open the form and run a query against it. This can be cleared by detaching the query.

        change your Release button script on the Sites form to this:
        Code:
        't=table.Sites()
        'query.filter="companyname=var->cname"
        'query.order="companyname"
        'query.options=""
        't.query_create()
        'parentform.resynch()
        
        t = table.current()  'get pointer to the primary table in the set
        			  'supporting the form
        t.query_detach_all()  'detach the query that was run when the form opened
        parentform.resynch()
        Incidentially, your present script fails because the first line:
        t=table.Sites()
        is broken. This is not how to get a pointer to the primary table in the set supporting the form. Use the table.current() method instead, as I have illustrated. To climb a rung on the learning curve, dig out the help file and read up on "TABLE.CURRENT()" it will help you understand what my little script does.

        -- tom

        Comment


          #19
          Hi Tom,
          Thank you! I'll give it a whirl tomorrow morning, as I'm almost out of here and on to my other job.

          I'll do some studying tomorrow morning as well on the Table_Current.

          The Release button is one that I was using as a testing ground for your and Martin's suggestions. The real button that I need to use is the "Show All records in database" button with the ShowAll Icon. That script was developed in several ways with help from others via this thread.

          You say my script is broken - yet, it still queries properly...ain't that a switch?! (No pun intended!)

          I'll check in tomorrow and maybe the code ferry will have fixed it all for me ;)
          Thanks,
          Wanda

          Comment


            #20
            Wanda, the code I used in the Release button works fine in the Show All Records in Database button:

            Code:
            t = table.current()
            t.query_detach_all()
            parentform.resynch()
            It would be prudent to precede this code with another action statement that checks the mode of the form and prompts the user to cancel or save pending unsaved edits before releasing the query. I'm not sure what would happen if the user started editing a record, didn't save it, and then pushed your button. Might be messy.

            -- tom
            Last edited by Tom Cone Jr; 06-27-2006, 02:06 PM.

            Comment


              #21
              OnInit

              Wanda,

              Think about this.
              The buttons on the Quick Screen does this:
              1. Generates a variable for a search term, say something like vSiteSrch..

              2. Runs a 'probe' of the table with the same filter expression for the search using (a5_get records_in_query()=0). If true a message comes up "No records". If false, open the Site form.

              3. The Site form contains saved Queries, including a saved query 'EquakeY' for this particular example.

              4. The Site form has OnInit script as follows:

              Code:
              [COLOR="RoyalBlue"]'Run Saved Query as variable vSiteSrch dictates[/COLOR]
              
              if vSiteSrch = "EquateY" then 
              	topparent.Run_Saved_Query("EquakeY")
              else if vSiteSrch = "FlZnNo" then
                           topparent.Run_Saved_Query("FlZnNo")
              etc
              etc
              end if
              You can run as many different searches as you have buttons. And I'm thinking you wouldn't have to have as much scripting as I am seeing. The "release search' button would be a single action script "Show All records or InLine XBasic topparent.show_all()

              That is my 2 cents.

              Mike W
              Mike W
              __________________________
              "I rebel in at least small things to express to the world that I have not completely surrendered"

              Comment


                #22
                Wanda,

                I have sent back your database with the following changes that address your issue:

                Quick Screen: I saved your buttons below others and made new ones (Blue) that : 1) generates a Variable (vSiteSrch) to direct a Query in the Site form (more later). 2) Probes the table for matching records using a5_get_records_in_query() before it opens. If no matching records-> message. If matchings records, it opens the Site form.

                Site Form: Added a command on the form OnInit Event that fires the appropriate query for the button pushed through the variable generated above (with Stan Mathew's help). The queries are on the form and you can find them in the control panel operations tab as SQEquakeY, SQFloodN, and SQFireY. I named them with that convention to keep them together (SiteQuery<queryfield><desiredresult>). THE NAME OF THE QUERY MUST BE EXACTLY THE SAME AS THE VARIABLE GENERATED BY THE BUTTON.

                The Equake and Fire buttons I wrote in Action Scripting. The Flood in Xbasic using mostly the code that was there. FYI. In that code (below), the beginning part present in each button, that highlighted in red below is both unnecessary and useless. You can basically copy and paste the buttons for each query, changing 2 things, the variable name generated, and the field being probed with a5_get_records_in_query(). In the Action Scripting, this is within the GOTO Label.

                The query (filter) being on the form allows for the "Show All" to work. Hope this helps.

                Mike W

                Code:
                [COLOR="RoyalBlue"]'Are there matching records present in the table?[/COLOR][COLOR="Red"]
                dim global tbl as P
                dim global qry as P
                dim global nrecs as N
                
                tbl = table.open("sites")
                
                query.description = "Search for matching records"
                query.order = ""
                query.filter = "trim(Sites->fire)=\"Y\""
                query.options = ""[/COLOR]nrecs= a5_get_records_in_query("sites","fire=\"Y\"")
                
                IF (nrecs = 0) then
                ui_msg_box("Null Query","There are no matching records in this search, unable to proceed" ,UI_INFORMATION_SYMBOL)
                tbl.close()
                end        'If there are no matching records, script ends here
                Mike W
                __________________________
                "I rebel in at least small things to express to the world that I have not completely surrendered"

                Comment


                  #23
                  Mike, nice work. Your solution uses almost 100% action scripting.

                  Wanda, it's worth noting that Mike's saved query operations are defined for the set that supports your Sites form. They are not defined for the table which is primary in that set. A subtle, but important, distinction.

                  -- tom

                  Comment


                    #24
                    WOW! Tom and Mike - you are my heroes for the day!
                    I tried the simple "Release Query" script and it works like a charm. THANK YOU!!!

                    Now, I will spend time going over Mike's code for the search buttons and will try to implement it into all my search forms. It's awsome that you actually coded in my app and sent it back. I'm humbled!

                    A wine country tour to all who helped if you ever make it out this way!

                    Very sincerely,
                    Wanda

                    Comment


                      #25
                      Hey Tom, Mike,

                      Here is my effort to "prudently" (got a kick out of your choice of words) include code to encourage user to save or discard changes. The code is hung up on the mode command. I have no clue what else to try, as this script was from a few people, last week or the week before - primarily Stan, Martin and Cheryl. Can you suggest what "mode" to use?
                      Thank you,
                      Wanda

                      Comment


                        #26
                        What is your current code and what is the error?
                        Cheryl
                        #1 Designs By Pagecrazy
                        http://pagecrazy.com/

                        Comment


                          #27
                          Duh - I'm glad you're awake, Cheryl!

                          DIM mode as c
                          mode = parentform.mode_get()
                          'If the form is in Enter or Change mode, first save the changes before closing the form
                          if mode = "ENTER" .or. mode = "CHANGE" then
                          parentform.commit()
                          'Check to see if the record was successfully saved
                          if parentform.mode_get()<>"VIEW" then
                          ui_msg_box("Unable to save your changes","Please correct and save, or discard your changes", UI_STOP_SYMBOL)
                          end
                          end if
                          end if
                          t = table.current()
                          t.query_detach_all()
                          parentform.resynch()

                          Comment


                            #28
                            Wanda, a good way to continue climbing rungs in the ladder representing your learning curve is to study each line of these scripts until you understand what they do. Take them one at a time. Do not accept scripts from others and use them in your app without understanding what they do and don't do. Ask questions if you hit a line that you can't find in the helps or which you still don't get.

                            -- tom

                            Comment


                              #29
                              Wanda,

                              I do not see anything wrong with the code. Exactly what is happening?
                              Cheryl
                              #1 Designs By Pagecrazy
                              http://pagecrazy.com/

                              Comment


                                #30
                                Tom,
                                I do readh through and try to understand the lines...but if I bugged you guys with every line I didn't get - none of us would get anything else done. At least I'm making a greater effort and some of it is making sense...now on to Cheryl's helping me...

                                Cheryl,
                                The error I get is "Arguement is incorrect data type"
                                Do I need a blank line anywhere, maybe?
                                Wanda
                                PS Error is on line 6: Mode=parentform.mode_get()
                                Last edited by Wanda Tucker; 06-28-2006, 11:43 AM.

                                Comment

                                Working...
                                X