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 return to same form after query returns 0 recs

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

    #16
    Wanda,

    Code:
     tbl = table.open(sites)
    should be:

    Code:
     tbl = table.open("sites")
    Note my comment in the previous thread:

    Note the 'red' text in the above code. You would need to substitute those with your table, filter, order enclosed in quotation marks "".
    Cheryl
    #1 Designs By Pagecrazy
    http://pagecrazy.com/

    Comment


      #17
      Thank you :) I did not your comment, but nothing shows up in red on my computer, for some reason. Also, being so dang literal, I thought you meant that the order should be enclosed in quotation marks...not all in your list (i.e. table, filter, order..)

      I'll get back to it tomorrow. Thanks, again - Wanda

      Comment


        #18
        Originally posted by Wanda Tucker
        Thank you :) I did not your comment, but nothing shows up in red on my computer, for some reason. Also, being so dang literal, I thought you meant that the order should be enclosed in quotation marks...not all in your list (i.e. table, filter, order..)

        I'll get back to it tomorrow. Thanks, again - Wanda
        If you decide to experiment with hiding the control panel, you can create two buttons on some form, one with the action script category - Control panel - Control panel hide. The other should have 2 action script category - Control panel - one action - Control panel show, and one action - Control panel set focus. You don't need to password protect them until you want to. Pushing the hide button will put you in the user state that you will have when you do hide the control panel for good. Pushing the other will return you to your development state.
        There can be only one.

        Comment


          #19
          another option

          Wanda,

          If Cheryl's code is giving you a problem, then maybe look at this:

          Code:
          dim nrecs as N
          
          nrecs= a5_get_records_in_query(" [COLOR="red"]<tablename>[/COLOR] ", " [COLOR="red"]<query.filter>[/COLOR] ")
          
          If (nrecs=0) then 
          	ui_msg_box("Null Query","No matching records found")
          else
          	varP_Sites = :Form.viewqueried(" [COLOR="red"]<layout_name>[/COLOR] ", " [COLOR="red"]<query.filter>[/COLOR] ", " [COLOR="Red"]<query.order>[/COLOR] " )
          
          end if
          For my application which uses a variable (Sterm) in the filter (field contains characters in the variable), it is the following:

          Code:
          dim nrecs as N
          dim Sterm as C
          
          nrecs= a5_get_records_in_query("cases",s_quote(Sterm)+" $ specimentype")
          
          If (nrecs=0) then 
          	ui_msg_box("Null Query","No matching records found")
          else
          	varP_Sites = :Form.viewqueried("cases2", s_quote(Sterm)+" $ specimentype", "" )
          
          end if
          Hope this helps.

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

          Comment


            #20
            Hi Mike, Cheryl, Stan...
            In working with Cheryl's code, I'm now stuck on the line of code:

            qry = tbl.query_create()

            I've tried several "guesses" as to what I need to do with this code. The error message is "No such field"...so I've tried using quotes, naming the table, then the field, and even simply deleting the line since I don't really need the query created. It is a saved query that I need to run, and it is named in the line query.filter = filter_Name. However, it's not a filter, either - rather, it is a query. So, once again, I'm clueless. It's like driving around in a huge metropolis with only the name of the street I need to get to - yet having no clue whatsoever what side of town it's in. I could spend days, like a rat in a maze, poking blindly at anything that might get me there.

            As you can see there are probably a hundred or so combinations of guessing I could try, given time. Yet, I don't have several days just to get ONE CODE TO WORK.

            Now, am I to believe that Mike's original line of code - just one line - will do the same thing as Cheryl's multiple lines of code - and/or the same as Mike's several lines of code? Doubtful....

            Here I go, though, trying Mike's first suggested ONE LINER...although, I'm about ready to give up again, as code makes no sense at all to me. I have yet to write any code that actually works - maybe today's the day.
            Thank you,
            W

            Comment


              #21
              Wanda,

              In my sample, are you using:

              Code:
               query.filter = "trim(Sites->Equake)=\"Y\""
              As far as your question about Mike's code, I have not personally used that function, but the best I can tell, yes his few lines of code should accomplish the same results as mine.
              Cheryl
              #1 Designs By Pagecrazy
              http://pagecrazy.com/

              Comment


                #22
                Hi Cheryl,

                Thanks for trying to come to my rescue, again :)

                No, your example doesn't look like that line of code. Rather, it is like this:

                query.filter = "equate"

                I just edited the code to match the code you just posted and didn't get an error message (for that line).

                I'm still stuck on the line of query.create. It needs a tag, such as <C> <D> <U> <N>. What character do I put there? What do they mean? They aren't drive names, are they?
                W

                Comment


                  #23
                  Hi Wanda,

                  No they are not drive letters. The sample I provided and the meaning of the option letters can be found at:

                  http://support.alphasoftware.com/alp...Y_CREATE().htm

                  But the option is not needed, nor is it included in my working sample.

                  If you are still getting the error on the query_create() line, saying no such field, my guess is the problem is with your query.filter line.

                  If you can attach the table/set that you are trying to accomplish this on, we can help a lot easier with what is causing the errors.

                  The sample I provided I actually use as a function and call the function in multiple query by form searches without any errors. My function is probably no different than the function Mike has pointed to (but I created mine because I was not aware of Mike's :)
                  Cheryl
                  #1 Designs By Pagecrazy
                  http://pagecrazy.com/

                  Comment


                    #24
                    xbasic query construction examples

                    Originally posted by Wanda Tucker
                    Okay, Stan. Thank you for your encouragement...where do you get your patience? I'll work with it tomorrow :)
                    Wanda

                    Just when you have time or decide to delve further. Pretty self explanatory in usage. Code behind buttons is heavily commented.
                    There can be only one.

                    Comment


                      #25
                      Hi Cheryl,

                      Here is what I have in the line of Mike's code that I'm working with on a different button...


                      nrecs= a5_get_records_in_query("sites","equake=Y",<query.filter="equake">,L,<sites>)

                      I get the error message: Expected value. I have no clue what value it wants. I looked at the options and some of them pique my interest. Since the error message insists on one of the "options", I tried one, to no avail.

                      Again, I'm clueless. I'll zip and attach the db. Thank you so much for all your galant efforts.
                      W

                      Comment


                        #26
                        Originally posted by Wanda Tucker
                        Hi Cheryl,

                        Here is what I have in the line of Mike's code that I'm working with on a different button...


                        nrecs= a5_get_records_in_query("sites","equake=Y",<query.filter="equake">,L,<sites>)

                        I get the error message: Expected value. I have no clue what value it wants. I looked at the options and some of them pique my interest. Since the error message insists on one of the "options", I tried one, to no avail.

                        Again, I'm clueless. I'll zip and attach the db. Thank you so much for all your galant efforts.
                        W
                        nrecs= a5_get_records_in_query("sites","equake=\"Y\"")
                        There can be only one.

                        Comment


                          #27
                          Originally posted by Stan Mathews
                          nrecs= a5_get_records_in_query("sites","equake=\"Y\"")
                          Cool...this code solves Line 16 error...now, I have a Line 18 error...Arguement is incorrect data type.

                          The line is: nrecs = qry.records_get()

                          Do I need to write it like:

                          nrecs = qry.records_get("sites", "equake=\"Y\") ?

                          Maybe we're getting there...thank you.
                          W

                          Comment


                            #28
                            Originally posted by Wanda Tucker
                            Cool...this code solves Line 16 error...now, I have a Line 18 error...Arguement is incorrect data type.

                            The line is: nrecs = qry.records_get()

                            Do I need to write it like:

                            nrecs = qry.records_get("sites", "equake=\"Y\") ?

                            Maybe we're getting there...thank you.
                            W
                            Since you are using

                            nrecs= a5_get_records_in_query("sites","equake=\"Y\"")

                            you can delete

                            nrecs = qry.records_get()
                            There can be only one.

                            Comment


                              #29
                              Hi Wanda,

                              It almost sounds like you are combining my sample with Mike's. Perhaps you can give us your code as you have it now?
                              Cheryl
                              #1 Designs By Pagecrazy
                              http://pagecrazy.com/

                              Comment


                                #30
                                Originally posted by Wanda Tucker
                                Cool...this code solves Line 16 error...now, I have a Line 18 error...Arguement is incorrect data type.

                                The line is: nrecs = qry.records_get()

                                Do I need to write it like:

                                nrecs = qry.records_get("sites", "equake=\"Y\") ?

                                Maybe we're getting there...thank you.
                                W
                                Since you are using

                                nrecs= a5_get_records_in_query("sites","equake=\"Y\"")

                                you can delete

                                nrecs = qry.records_get()

                                Actually, you should post the entireity of the code you are now using. Once you use nrecs= a5_get_records_in_query("sites","equake=\"Y\""), several other lines from earlier attempts are also not needed.
                                There can be only one.

                                Comment

                                Working...
                                X