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

Combo Box, creating range of choices

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

    Combo Box, creating range of choices

    Hi all,

    I need some help and direction in figuring out how to have a standard Combo Box show a range of prices for each product that will be sold and then be able to choose one of the prices for the product(with the option of adding their own values too). Radio buttons could be used but are limiting and take up valued form space.

    I want the user to be able to set a range of prices, in increments, that will show in the Combo Box. This could be either a price range (say $0.50 to $0.80 in $0.05 increments) or a specific number of prices (say 10 prices, starting at $0.50, incremented by $0.05). All of the criteria should be able to be set by the user. And, once set, they are to remain as part of where that product is being sold(a lane or row in a vending machine) so the next time the product is looked at in the form, what was was chosen before is still there--but of course can be changed at any time wanted.

    I could have a separate table in which a user could add records to via a form--and would then need to know how to set the range of prices as stated before (I cannot predetermine all the possible prices in a table as there are so many products with differing price ranges).


    The preferred method would be if there is a way to have form fields that the user could enter in the criteria; starting price, price increment, range or number of prices shown. Is this even possible with a Combo Box??

    I have tried a few ways to see what I could come up with but am now at the confusion stage---don't even know at this point whether the $ fields / variables should be numeric or character! I at first figured that they should be numeric as it seemed the process used to attain my goal involved calculations, but then saw a few posts on the board that seemed to indicate a character field was needed....

    If something like this would take too long to give an example, then maybe someone could steer me in the right direction so I could then try to do this on my own.

    Thanks,


    Mike
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




    #2
    Re: Combo Box, creating range of choices

    Mike, you've got several things going on at the same time.

    suggest you set a default value field rule that retrieves the field value in the most recent transaction record for the same product.

    suggest you use a table lookup field rule to retrieve the pricing options for each product. Each optional price would be a separate record.

    populate the lookup table with a script that collects the input from the user (lowest price, highest price, increment value), and then enters the records one after the other using a loop. This same script will need to delete previous pricing records from the lookup table for the same product.

    -- tom

    Comment


      #3
      Re: Combo Box, creating range of choices

      Hi Tom, thanks for the lead...I will check into doing it that way.

      Mike
      Mike
      __________________________________________
      It is only when we forget all our learning that we begin to know.
      It's not what you look at that matters, it's what you see.
      Henry David Thoreau
      __________________________________________



      Comment


        #4
        Re: Combo Box, creating range of choices

        Hi everyone.

        As you can gather from how long it has been since my last post I am VERY much still learning as it has taken a few hours each night (mostly working on this) since then to finally come up with something that works! :-)
        I ended up going with something a bit different. I have a Combo Box that shows all the prices available but it seems to auto-scroll most of the time to include the currently selected price--if I can get this to be more consistent then that would cure the problem of so many prices to look through. I can create or delete any range of prices that show up in the dropdown combo box list also.

        I still would like someone to look at what I ended up with for script and let me know how to
        use:


        1. pointers to my tables/fields - received errors of no such table & no such field
        2. "x" and "y" to equal something --errors of could not find "x", "y" and expected value

        ---see code below to see how I was trying to use this.

        And If possible look at the "Range" code below and let me know why the commented out if....then could not be used instead of what I ended up having to use directly below it - it would cause a continuous loop that would crash Alpha.

        I developed two different methods to create prices for the Combo Box. I first tried to figure out how to create them with a range of wanted prices--did not work (at first). So I created a way to add prices by using a Number of Prices field. Later on, after finally solving this I went back to see if I could do it by selecting a range and lo and behold I accomplished it in less than an hour---go figure!

        The set is made as follows(both are one to one):
        Lane(parent)
        --> Prod (child)
        --> Prices (child)

        The Combo Box (based on the numeric field Price_Lane) is on a set based form (Chg_Lane). A button on this form opens another form (Enter_Prices--based on table Prices) in which prices can be created or deleted from the child table Prices. A screenshot of the latter form is attached.

        This is the code that works for creating prices using Number of Prices:


        Code:
        if Enter_Prices:No_Prices.value <= 0 then
           end
        end if
        
        for i = 1 to 99
        
        Enter_Prices:Price.value=Enter_Prices:Beg_Price.value+(Enter_Prices:No_Prices.value-1)*Enter_Prices:Incr_Price.valueEnter_Prices:No_Prices.value = Enter_Prices:No_Prices.value - 1
        topparent.commit()
        if Enter_Prices:No_Prices.value <= 0 then
           end
        end if
        
        next i
        end
        ----------------------------------------------
        Although I am not going to use this method (using Range method), the way to accomplish this can be applied to my other scripts.
        The following does not work for creating prices using Number of Prices.

        (just a thought--do I have to dim as Global, etc?):


        Code:
        dim x as n
        dim y as n
        x=Enter_Prices:no_prices.value
        y=Enter_Prices:no_prices.value
        
        for i = 1 to y
        
        Enter_Prices:Price.value=Enter_Prices:Beg_Price.value+((x-1)*Enter_Prices:Incr_Price.value)'have tried with and without outer "( )"
        
        topparent.commit()
        
        x = x - 1
        
        if x = 0 then'
           end
        end if
        
        next i
        
        end
        ---------------------------------------------
        The following is just for any other inexperienced person that may find it useful! :-)

        Range Script:


        Code:
        for i = 1 to 99
        
        Enter_Prices:Price.value=Enter_Prices:Beg_Price.value'+(Enter_Prices:No_Prices.value-1)*Enter_Prices:Incr_Price.value
        Enter_Prices:Beg_Price.value = Enter_Prices:Beg_Price.value + Enter_Prices:Incr_Price.value
        topparent.commit()
        'if Enter_Prices:Price.value=Enter_Prices:End_Price.value then
        if Enter_Prices:Beg_Price.value > Enter_Prices:End_Price.value then
           end
        end if
        
        next i
        end
        ------------------------------------------------------------

        'Delete Script - when using Action Script to set a variable to a constant or expression it ALWAYS uses C for character even if you designate it as N for numeric---have to change the action script into xbasic and change the C to N for it to work.

        OnChange Event for dBeg_Price and dEnd_Price

        Code:
        'Update value in existing variable 'vc_Beg_Price' to '=dBeg_Price
        vc_del_Beg_Price = convert_type(a5_eval_expression("=dBeg_Price"),"N")
        
        'Update value in existing variable 'vcEnd_Price' to '=dEnd_Price
        vc_del_End_Price = convert_type(a5_eval_expression("=dEnd_Price"),"N")
        --------------------------

        'OnPush Event for Delete Button--Operation which deletes a range of prices


        Code:
        'Prompt for confirmation before running the Operation.......
        dim rec_count as n 
        rec_count = a5_get_records_in_query("prices","between(Price,Var->vc_del_Beg_Price,Var->vc_del_End_Price)")
        message_text = rec_count + " record(s) will be deleted from 'prices'."+crlf(2)+ "OK to proceed?"	
        
        operation_result=ui_msg_box("Delete Selected Records Operation",message_text,UI_OK_CANCEL+ UI_FIRST_BUTTON_DEFAULT+ UI_INFORMATION_SYMBOL)
        If operation_result <> ui_ok_selected then 
        	end 
        end if 
        
        
        a_tbl = table.open("prices")
        a_tbl.delete_range("between(Price,Var->vc_del_Beg_Price,Var->vc_del_End_Price)")
        a_tbl.close()
        
        'Display a dialog box showing the results of the Operation
        a5_mark_op_result("prices","Delete Selected Records",a_records_processed, a_records_total)
        
        
        'If the Operation is run from within a Form or Browse, then refresh the window
        if is_object(topparent.this) then 
        	if topparent.Class() = "form" .or. topparent.class() = "browse" then 
        		topparent.Refresh_layout()
        	end if 
        end if
        -------------------------------------------------------------

        Operation script (from Action Scripting) for deleting duplicates
        --used on the OnPush Event of the OK button which closes the form after running this operation.

        Code:
        'Run an Operation that was previously defined.
        query.filter = ""
        query.order = ""
        
        DIM operation_name as c
        operation_name = "Dupe_Del_Prices"
        If operation_name <> "" then 
        	mark.run(operation_name,query.filter)
        End if

        If needed I will get an example to post of the relevant tables and forms.

        Thanks to anyone who has a bit of time to explain these things---I hope that the explanation will enable me to accomplish future tasks a bit quicker ( LOL hard to get any slower I think!)

        Mike

        Last edited by MikeC; 07-20-2006, 08:55 PM.
        Mike
        __________________________________________
        It is only when we forget all our learning that we begin to know.
        It's not what you look at that matters, it's what you see.
        Henry David Thoreau
        __________________________________________



        Comment

        Working...
        X