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

CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

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

    CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

    I have a form with custom toolbar and a FINDBYFORM button with a nextrecord plus a previos record buttons. They work fine.
    I have tried to use CURRENT_FILTER_EXPN() to get the value stored by Alpha in the FINDBYFORM, but it does not show anythig.
    I must be using it wrongly.
    The problem is, I would like to see a browse with only the matching records based in the FINDBYFORM.
    The default browse button in the toolbar, does display all records.
    I need to create new button to display the browse or add an additional expression to the toolbar browse button.
    Does any one have away of doing it?

    #2
    Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

    Try

    MRU_QUERY("yoursetname.set").filter
    or

    MRU_QUERY("yourtablename.dbf").filter
    There can be only one.

    Comment


      #3
      Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

      Stan I need to post a code, but I forgot how to keep the indentations. Please advise
      Last edited by MikeData; 04-10-2013, 06:01 PM.

      Comment


        #4
        Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

        I found the way to keep the indents.

        I get the folowing erros: filter expression not logical two times and argument is incorrect data type
        then the browse opens showing all records.
        Suggestions?
        here is the code:


        HTML Code:
        'query.filter = "MRU_QUERY(\"torder.dbf\").filter"
        query.filter = "MRU_QUERY(\"torderset.set\").filter"
        query.order = "recno()"
        
        'Open the layout_type showing just the records that satisfy the filter
        DIM Shared varP_orderBrowseQk_s1 as P
        DIM layout_name as c 
        layout_name = "orderBrowseQk_s1"
        
        dim tempP as p
        'Get pointer to existing window. In case layout_name is qualified with a dictionary name, extract up to first @. In case formname has spaces, normalize it
        tempP=obj(":"+object_name_normalize(word(layout_name,1,"@")))
        'Test if pointer is valid
        if is_object(tempP) then 
        	'Test if pointer refers to a form or browse
        	if tempP.class() = "form" .or. tempP.class() = "browse" then 
        				dim flagIsBaseFilter as l 
        		flagIsBaseQuery = .t.
        		
        		if flagIsBaseFilter then 
        			'Apply the query to the form or browse as the Base query. (this means that 
        			'the user cannot turn the query off, only add to the query)
        			tempP.BaseQueryRun(query.filter,query.order)
        		else
        			tempP.QueryRun(query.filter,query.order)		
        			
        		end if 
        		
        		'then activate the already open window
        		tempP.activate()
        	else
        		'Window is not already open, so open it
        		varP_orderBrowseQk_s1 = :Browse.viewqueried(layout_name,query.filter, query.order )
        
        	end if
        else 
        	varP_orderBrowseQk_s1 = :Browse.viewqueried(layout_name,query.filter, query.order )
        
        end if

        Comment


          #5
          Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

          I am curious as to what the IW showed was the expression returned?
          Last edited by MoGrace; 04-11-2013, 11:51 AM.
          Robin

          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

          Comment


            #6
            Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

            Nothing, as I can see. Only the errros mentined above. then the browse opens fine, but with all records.

            Comment


              #7
              Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

              Try a quick multi filter on the form to get the records you expect and open the IW set to that form and test the MRU_Query() function. Other than that, it might be that you have to redirect the output to a variable first and then set the query.filter with that var's parsed expression.

              So that:

              filter = "field = "+quote(myvar) ' or in this case use the MRU_query() as you did above.

              becomes

              field = "actual value" for the query.filter to use. Then

              query.filter = filter

              might work
              Last edited by MoGrace; 04-11-2013, 01:03 PM.
              Robin

              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

              Comment


                #8
                Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

                I tried it, hope I did use the right coding/formating


                dim field as c
                filter = "field = "+quote("MRU_QUERY(\"torder.dbf\").filter")
                query.filter = filter
                query.order = "recno()"

                Does not work, give same error.

                I tried:

                dim cs as P
                cs = mru_query("torder.dbf")
                query.filter = "cs"
                query.order = "recno()"


                same results.

                I must be using the wrong syntax or placing the items in the wrong place

                Comment


                  #9
                  Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

                  I'm sorry Mike I didn't mean that as an exact code to use other than as an example. What I was trying to explain was how in the Interactive Window, you might see what the expression is supposed to look like after using the multi field quick filter on the form to get the records you want to see selected by the filter. Then given that we could construct a filter to use where the expression has already been parsed before you put it as the query.filter. Hope that made more sense...
                  Robin

                  Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                  Comment


                    #10
                    Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

                    Thanks Robin and Stan for your reponses.
                    The task that I am confronted, was to me a simple one, as in other programs is inherited or built in.
                    Alpha has more features than most programs. Yet it appears that my problem is not a simple task.
                    Using the MRU_QUERY() should do it, but how to use it is not clear to me from the instructions on line.

                    I am attaching a sample with the buttons in the namesform and I think with a clear explanation of my objective with a note in the form.

                    There is got to be a way to filter the findbyform.


                    Please advise.

                    Comment


                      #11
                      Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

                      Hi Mike,
                      I made you a Search Form instead using Xbasic - take a look and see if will work for you.
                      Attached Files
                      Last edited by MoGrace; 04-12-2013, 03:35 PM.
                      Robin

                      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                      Comment


                        #12
                        Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

                        Robin, Thanks for the suggested approach. I was returning this afternoon in a long drive and I was thinking along those lines. My approach was to use an scheme where I could load the value of those fields (Just monitoring a few of them and load the values intd a tem variables , just before the click find) and upon clicking to open the browse, do the filtering by the criteria in those fields.
                        Not very clean and very limited, but I could buy some time until I solve the issue.
                        The reason for this insistance to solve the problem is that the customer comes from from a DB where this was built in.
                        In that DB you did not even have to click findbyfrom, just move to the fields you want, fill your criteria, (it could be 1, 2, 3, and more fields) click search, then the program return the records page by page, just like Alpha does. If you want to see that data in browse view, just click a button and presto, only the seleted records were there.
                        As you can see I have to be able to find the values in the findbyform. Alpha does have it. How do they manage the information from findbyform must be somewhere. Is hard to belive no one had this need before.
                        Again thanks for the effort, as I will use some of that code to accomplish my approach.
                        I really need to solve this issue.

                        Comment


                          #13
                          Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

                          Mike, you could create a form that opens directly in findbyform or querybyform mode...then a hotspot on the form in the tab order could run the search. Sounds like your users are coming from a DOS program, where a form opens blank until a key field is filled in then finds it if it exists or begins a new record.

                          Edit: Here's a script using a progressive lookup dialog I use to find an employee by lastname, firstname or fileno. I adapted it to use with your table and form. There is also a function used in the dialog that is included - import them into the Code tab of the Control panel and then try the Go_dlg_frm script.
                          Attached Files
                          Last edited by MoGrace; 04-12-2013, 11:01 PM.
                          Robin

                          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                          Comment


                            #14
                            Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

                            I think you need to use query by form instead of find by form. Find by form goes to the first matching record within the current record set without changing the set of records. Therefore there is no filter used and non to return to any of the functions you are trying to use. Query by form on the other hand does use a filter and reduces teh record set to only those that match the search criteria. Then you could just press the browse button on the toolbar or the F8 key to switch to the companion browse. Or in your button code that opens a seperate browse set the filter option to use currently selected records.
                            Tim Kiebert
                            Eagle Creek Citrus
                            A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                            Comment


                              #15
                              Re: CURRENT_FILTER_EXPN() only returns T. How to get the value of 'FindByForm'

                              Thanks Tim. I am testing your idea and I will see how simple I can make it for the user.
                              It does fill the browser and the counter in the toolbar reflects the numbers.

                              Attached is an updated sample with your idea plus Robin approach.

                              You can go to the main menuform and see the choices so far.
                              1 original using findbyform and no filter yet
                              2 The approach by Robin
                              3 An approach by Tim using querybyform

                              One Question: Is there a limit in the number of fields querybyform will accept for criteria?
                              I did test for 3 , and it works.

                              I still would like to learn more about the options I did found in the Alpha guide under the title Query Functions and Methods.
                              That is where I saw MRU_QUERY and CURRENT_FILTER_EXPN() plus many others I have not seen before.

                              Again Thanks to Stan, Robin and Tim.
                              Last edited by MikeData; 04-13-2013, 01:35 PM.

                              Comment

                              Working...
                              X