Welcome to Axure Community Site Sign in | Join | Help
in Search

Dynamically Add/Remove List Box Values

Last post 10-30-2009, 1:17 PM by victor. 7 replies.
Sort Posts: Previous Next
  •  05-29-2008, 10:40 AM 2888

    Dynamically Add/Remove List Box Values

    Hello,

    I'm a new user of Axure and new to this site. I searched for an answer, but I couldn't find anything similar to my problem. I'd like to be able to modify the values that appear in a list box using buttons. I have a page with the following widgets:

    New Value text field
    List of Values list box
    Add button
    Remove button

    I want to type a value into the New Value text field, click the Add button, and have the new value appear in the List of Values list box. Similarly, I want to be able to select a value in the List of Values list box, click the Remove button, and have the value disappear from the list.

    Is there any way to do this dynamically or is my best bet to just make some mock-up panels to simulate this functionality for my customers?

    Thanks in advance.

    Brie

    Filed under: , ,
  •  05-29-2008, 2:28 PM 2891 in reply to 2888

    Re: Dynamically Add/Remove List Box Values

    Hi Brie,

    Thanks for the post. There isn't a way to do this dynamically. Using a dynamic panel with some sample scenarios is the best way to show this today. We're considering adding the ability to dynamically set the options in a list.

  •  03-24-2009, 10:40 PM 4663 in reply to 2888

    Re: Dynamically Add/Remove List Box Values

    Hi, I'm also a beginner in Ms Access. Due to my limitation on VBA coding, I can only help u to resolve the "add value" part to list box.For "remove value" part, I still don't know what code to use. Perhaps you can help me?

    Basically, there are three ways as follows:-

    1. You can add/remove value into list box freely. However, it doesn't bound to table/queries. You can refer to this site for futher info http://www.599cd.com/tips/access/listbox-additem-2000/

    2. You can add/remove value into bound list box(bound to table/queries) by create a command button(add value). The function of this button is to open another form that contain  bound text box(for you to type your new value here). Then create another two buttons: "ok" & "cancel". The trick is when you click "ok" button. It close the form and at the same time requery the list box value.

    3.Finally, last method is the most easy way and most similar to your question. You'll need to create bound table and bound text box. Then, you create "add value" command button. The trick is on the "on click" property  of "add value" command button. You need to put requery coding.

    That's all I can help you

    For the 2nd way, you need this code  at "on click"  for "ok" button:-

    Private Sub cmdOk_Click()
    On Error GoTo Err_cmdOk_Click

        DoCmd.Close
       Forms![Form1]!List0.Requery
    Exit_cmdOk_Click:
        Exit Sub

    Err_Command2_Click:
        MsgBox Err.Description
        Resume Exit_cmdOk_Click
       
    End Sub

    For the last method, you need to put this code at "on click" for "add value" command button:-

    Private Sub Command9_Click()
    On Error GoTo Err_Command9_Click

        DoCmd.GoToRecord , , acNewRec
        Me.Form!List2.Requery
    Exit_Command9_Click:
        Exit Sub

    Err_Command9_Click:
        MsgBox Err.Description
        Resume Exit_Command9_Click

    End Sub

     

    All the best to you! Hope you can reply me a.s.a.p on how it works!!!!

  •  03-25-2009, 1:27 AM 4666 in reply to 4663

    Re: Dynamically Add/Remove List Box Values

    Hi Simon, thanks for the post. To clarify... this is a forum for Axure RP (and not MS Access).
  •  03-25-2009, 3:30 AM 4668 in reply to 4666

    Re: Dynamically Add/Remove List Box Values

    Oops, sorry!!! I don't even know its not Ms Access. Anyway, thx for your reminder.

  •  10-29-2009, 3:36 PM 5906 in reply to 2888

    Re: Dynamically Add/Remove List Box Values

    Have you decided to include dynamic lists in an upcoming release?

     

    Thanks

  •  10-30-2009, 1:15 PM 5912 in reply to 5906

    Re: Dynamically Add/Remove List Box Values

    Hi Liz G, we know we want to add the actions to enable this, just not sure which release yet.
  •  10-30-2009, 1:17 PM 5913 in reply to 5906

    Re: Dynamically Add/Remove List Box Values

    Hi Liz G, we know we want to add the actions for this, but just not sure what release yet.
View as RSS news feed in XML