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

Filter Imbedded Browse with ComboBox

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

    Filter Imbedded Browse with ComboBox

    I have a form based on a set that has an embedded browse. I'm trying to create a combo-box with 4 static options that will filter the records in the browse. I've tried to create custom queries in action scripting, and then went to X-basic. So far, no matter what I try, nothing happens- no errors, but nothing changes. Here's my code so far:


    Code:
    Select case dropdown1.value
    	Case 1
    	parentform.queryrun("((Current_balance = 0  )  .and. (Trans_amt <> 0  ))")
    
    	case 2
    	parentform.queryrun("((Current_balance <> 0  )  .and. (Trans_amt > 0  ) .and. (Trans_code < 50  ))")
    
    	case 3
    	parentform.queryrun("((Trans_code > 50  )  .and. (Trans_code = 60  ) .and. (Trans_amt > 0) .and. isblank(\T_Sent_Customer_Data->Datesent\))")
    
    	case 4
    	'Show All Records.
    	parentform.show_all()
    
    end select
    	
    xbasic_wait_for_idle()
    
    parentform.Commit()
    parentform.Resynch()
    parentform.Refresh_Layout()

    And here's the field properties for the dropdown box
    Code:
    New Starts|1
    Paid In Full|2
    Additional Payments|3
    Show All A2I Data|4
    Just for background, I've a lot of experience with access and vbscript, but I'm an alpha newb, so I apologize if I'm overlooking the obvious. Any help is appreciated.
    Last edited by marvinbase; 05-06-2008, 12:52 PM.

    #2
    Re: Filter Imbedded Browse with ComboBox

    Jeff

    This works for me

    Code:
    Select case 
    
    	Case dropdown1=1
    	parentform.queryrun("((Current_balance = 0  )  .and. (Trans_amt <> 0  ))")
    
    	case dropdown1= 2
    	parentform.queryrun("((Current_balance <> 0  )  .and. (Trans_amt > 0  ) .and. (Trans_code < 50  ))")
    
    	case dropdown1=3
    	parentform.queryrun("((Trans_code > 50  )  .and. (Trans_code = 60  ) .and. (Trans_amt > 0) .and. isblank(\T_Sent_Customer_Data->Datesent\))")
    
    	case dropdown1=4
    	'Show All Records.
    	parentform.show_all()
    
    end select
    FWIW

    Tom

    Comment


      #3
      Re: Filter Embedded Browse with ComboBox

      No go for me- I get an undeclared variable error with the code you suggested. However, I've found out a couple of things:

      First, I can't have this in the OnChange event of the dropdown list, as it doesn't seem that this event is called when an item already in the list is selected. So I created a "go" button and added the code there.

      Second, putting quotes around the select case values seems to help, as now it is doing something- it's running the query for the first select statement. But, it's ONLY doing the first query, no matter what is in the dropdown list. This is driving me nuts.

      Here's my revised code:
      Code:
      Select case dropdown1.value
      
      	Case "1"
      	parentform.queryrun("((Current_Balance > 50  )  .and. (Trans_code > 50  ) .and. (Trans_amt > 0)))")
      	msgbox("New Start")
      
      	case "2"
      	parentform.queryrun("((Current_balance = 0  )  .and. (Trans_amt <> 0  ))")
      	msgbox("Paid In Full")
      
      	case "3"
      	parentform.queryrun("((Current_balance <> 0  )  .and. (Trans_amt > 0  ) .and. (Trans_code < 50  ))")
      	msgbox("Partial Payment")
      
      	case "4"
      	'Show All Records.
      	parentform.show_all()
      	msgbox("Show All Records")
      
      	Case else
      	msgbox("nothing selected")
      end select
      
      xbasic_wait_for_idle()
      
      parentform.Resynch()
      parentform:browse1.Refresh_Browse()

      Comment


        #4
        Re: Filter Imbedded Browse with ComboBox

        Jeff

        First, on the form I used to test the select statements with both a list box and a combo box, I created a global variable vc_dropdown and vc_newdrop.
        both were created as numeric.

        I placed that those variables as fields on my form vc_dropdown with a list box and vc_newdrop as the combo box.

        For the choices both the list box and the combo box were identical

        Alpha|1
        Beta|2
        Delta|3
        Everything|4

        I then used the on change for each of them with the following code

        Code:
        Select case  'this was for the list box - code was the same with a different 
                          'variable (vc_newdrop) for the combo box
                case vc_dropdown = 1
                    msgbox("","alpha")
                case vc_dropdown =2
                    msgbox("","beta")
                case vc_dropdown=3
                    msgbox("","delta")
                case vc_dropdown=4
                    msgbox("","Everything")
        end select
        Everything work as it should.

        Another thing, and it may be me, I have never seen the select case construct that you have "Select case download1.value" then case statements. Again that may be just me - but even the help files doesn't have anything like that (I come from VB and I can't remember ever using that construct.

        Second: If I made the code similar to yours with the above construct, I too would only get the msg of "Alpha"

        I did dim my variables in the form as global numeric. Evidently you are not using a variable.

        If you are then I don't understand the not dimmed error.

        I will post a copy of my test table for you to review in a few minutes. I have to set it up for just the one table - my test app has a a myriad of forms etc.

        So bear with me for.

        Tom
        Last edited by Tbaker; 05-06-2008, 02:36 PM. Reason: Added zip file

        Comment


          #5
          Re: Filter Imbedded Browse with ComboBox

          That worked-

          You're right, I did not declare a variable. Moreover, my combobox was unbound- there was no field for the selected value to attach to.

          I guess I didn't understand the need to declare a variable if I'm defining the value of the selected item in the combobox, and then pulling the selected value from the combobox in the code on the same form. Of course, that could be something microsoft did in the background, and I'm going to have to learn the differences in vbscript and xbasic. I can assure you that I've used that select case construct in the past with vbscript and vb.net.

          Thanks for your time and patience! I can now go continue beating my head against the wall, but at least it will be for a different project! :)

          Comment


            #6
            Re: Filter Imbedded Browse with ComboBox

            Jeff

            Just beat your head once and then turn to the forum. You can't beat it for the price (free).

            Oh, I'm an "if then else" man - used case statement in VB very rarely, in fact, when I did I used to refer to help (books in those days).

            Best of luck to you.

            Tom

            Comment

            Working...
            X