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

Using radio buttons correctly

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

    Using radio buttons correctly

    I am not sure I am on the right track. I thought I could use the following code to make a selection of records using a dialog box and radio prompts. In my example I would like to select records that have "Coming" in the STATUS field.

    'Prompt for a value using a radio button dialog box.
    DIM Shared vstatus as c
    DIM choice_list as c
    choice_list = <<%txt%
    All
    Active
    Applied
    Coming
    %txt%
    vstatus = ui_get_radio2("Select Status Value","Active",choice_list)

    The correct dialog box comes up and I can make the selection, but this code doesn't select any specific records (Coming) when I make a selection by clicking on the Coming radio button.

    Is there a second step I am not understanding and including?

    Thanks,

    Pete
    "Ollie, remember how dumb I used to be? Well, I'm much better now."

    Pete

    #2
    Pete, yes.

    What you have so far simply sets the choice in the variable vstatus. The radio button is a way to get input from the user. It does not, by itself, run any queries or apply any filters. You next have to query the table (or form) using a filter expression which limits records to those where your field value equals whatever choice is in vstatus. Does this make sense?

    -- tom

    Comment


      #3
      Originally posted by trackmanpete
      I am not sure I am on the right track. I thought I could use the following code to make a selection of records using a dialog box and radio prompts. In my example I would like to select records that have "Coming" in the STATUS field.

      'Prompt for a value using a radio button dialog box.
      DIM Shared vstatus as c
      DIM choice_list as c
      choice_list = <<%txt%
      All
      Active
      Applied
      Coming
      %txt%
      vstatus = ui_get_radio2("Select Status Value","Active",choice_list)

      The correct dialog box comes up and I can make the selection, but this code doesn't select any specific records (Coming) when I make a selection by clicking on the Coming radio button.

      Is there a second step I am not understanding and including?
      What you've done so far is fine, but yup, there's more to work to do. So far, you've set the value of the vstatus variable. Alpha has no idea what you want after that, so you have to tell it.

      In general terms, the next thing you want to do is apply a query to your table. How you do this depends on the location of your script relative to the table you want filtered.

      My guess, from reading your post, is that you want the records in the current form to display based on the status you choose. There are lots of ways to do this. One way:

      Make a filtered index for each of the choices you have. After your current code, you'd put something like this:

      Code:
      Select
        Case "Active" $ vStatus
           parentform.index_set("Active")
        Case "Applied" $ vStatus
           parentform.index_set("Applied")
        Case "Coming" $ vStatus
           parentform.index_set("Coming")
        Case Else
           parentform.index_set("")
      End Select
      -Steve
      sigpic

      Comment


        #4
        Thanks

        Steve:
        Thanks very much for the direction. I did look into the Select - End Select, but struggled with the composition. What I have is an embedded list on my form that I want to do the selection on.

        I will try your suggestion, which I think I understand, after getting some sleep. I must learn not to attack these problems in the middle of the night...:)


        Thanks again.


        Pete
        "Ollie, remember how dumb I used to be? Well, I'm much better now."

        Pete

        Comment


          #5
          Further dilemma

          I finally had a chance to work on my selection process again this morning. I think I understand what Tom and Steve conveyed in terms of the radio buttons just providing me with a variable that will be used to Select a sub group from my embedded list. I tried Steve's code, but nothing happened. I then tried using Action Scripting to create a Query that would first identify my varialble "vStatus" and then use that variable to select the records within my embedded list.

          That also did not work as I can't seem to locate any Action Scripting that would make this happen for me. Maybe I am still asleep at the switch.

          Any further help would be appreciated, as I would like to use this process for some other actions, including selecting different printing options down the road.

          Thanks again,

          Pete
          "Ollie, remember how dumb I used to be? Well, I'm much better now."

          Pete

          Comment


            #6
            Almost

            Well, as seems to be the case too many times, I finally did find a limited solution right after posting my questions to the group,

            Code:
            'Default comment text.
            DIM records_found as N
            records_found = topparent.queryrun("Status = Var->vstatus","R_lname+R_fname+R_mi","","No","<Cross Level>",.f.)
            What happens now is that the embedded listing does not reflect the selection, due to my not refreshing the list yet (I think), but at least I have been able to get the select to work.

            Thanks again for providing me with the ability to search the right area.

            Pete
            "Ollie, remember how dumb I used to be? Well, I'm much better now."

            Pete

            Comment


              #7
              Pete, shortest path to the solution, as has been mentioned many times on this board, is to post a working model of the database, with instructions telling us how to see / find the problem, and a narrative descriptions of how you want it to work.

              Your question seems to have morphed into a new topic. You're asking how to define and run a query but have not described the context for us. Is this for a form? for a report? For the primary table records? For the linked one to many child tables?

              A starting point for developing any scripted query, at least for me, is to define and run a query using a known constant value. In your case it would a query that using the constant "coming" as the search criterion for a query based on the Status field. Once that's accomplished, it's a matter of re-writing the filter expression to use a variable instead of the constant.

              Does this make sense?

              -- tom

              Comment


                #8
                As always, your comments are most appreciated and quite clear. My own difficulty is still understanding how all the different actions fit together. I am still not ready for x-basic, so using the Action Scripts has enabled me to go a long way in getting things done. However, knowing even all the power of the Action Scripts sometimes befuddles me. I thought by posting first my struggle and then my own solution, I might "contribute" a little to the forum, as I can't return favors yet with helpful solutions. Having both you and Steve provide me with direction was the impetus I needed to find the correct solution.

                My project continues to grow and develop, not only as I learn how to make things within the database happen, but as I think of more things that would be useful to the end user. I am still using training wheels, but am almost ready to take one of them off, I think.:)

                Pete
                "Ollie, remember how dumb I used to be? Well, I'm much better now."

                Pete

                Comment


                  #9
                  Pete, my previous reply must have crossed "in the mail" with your post describing the solution you found. I'm glad you have it working. Thanks for posting your solution.

                  -- tom

                  Comment

                  Working...
                  X