Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2002
    Posts
    403

    Unhappy Unanswered: Manipulating ListBoxes

    I have a contact type application, which is based around a tabbed form.

    Depending on the type of contact I select the tabs change to different titles.

    Each tab contains listboxes. In the listboxes are data relevant to the contact type. On slecting the contact type the listbox is manipulated by SQL statement to show a different content. So far so good.

    My problem is that the contact type is dynamic, and therefore subject to change at runtime. Ideally what I would like to do is to add a new sql statement to provide specific list data relevant to that contact. Trouble is I have no idea how this may be acheived?

  2. #2
    Join Date
    Apr 2002
    Location
    Portugal
    Posts
    146
    dynamictiger,


    What do you mean with dynamic contacts, could yopu be more specific!?

  3. #3
    Join Date
    Feb 2002
    Posts
    403
    The contact type (e.g. supplier, client, architect, etc) can be added to or changed at runtime, therefore it's contents are not static they are dynamic.
    Last edited by dynamictiger; 04-22-02 at 00:47.

  4. #4
    Join Date
    Apr 2002
    Location
    Portugal
    Posts
    146
    dynamictiger,


    Are you wanting something like this:

    If you change to supplier the listbox only shows data about suppliers, if you change to client, the listbox only shows data relevant to clients...

    If yes, than you just have to set the sql to a variable criteria, for example, using the form's control that you select, if it's supplier or client, and requery the listbox.

    Open the form in design view, right click to properties in the listbox, in it's hidden query, just set the search criteria based on that control, or you can put: "LIKE Forms![name]![Field]".

  5. #5
    Join Date
    Feb 2002
    Posts
    403
    Sort of. Unfortunately that is not quite the case. FOr example for clients, we show data in the list box about aquatic centres belonging to this client. For Aquatic centres the list box lists pool data, the list box completely changes the displayed data and columns and so on. For suppliers we show a listing of the products provided by them, that we have bought.

    For Architects we show clients they have worked with, and the pools they have designed and so on.

    In fact the list box, undergoes a complete metamorphis and can change everything including the table from which it retreives data for each contact type.

    As you can now see the list box goes through a complete change depending on client type selection.

    Hence the question as to how and if it is possible to write some sort of quassi sql at runtime.
    Last edited by dynamictiger; 04-22-02 at 16:59.

  6. #6
    Join Date
    Apr 2002
    Location
    Portugal
    Posts
    146
    dynamictiger,


    It's possible to do it by code, using the dbengine properties, and openning the recordsets. But is more dificult doing it by code, because each client or supplier as you said, requires diferent querys, so you have to open various recordsets, and the number of columns too.
    The best way for you to do that, is creating a listbox for each situation, and turn them invisible, so when you need one, just turn it visible.

  7. #7
    Join Date
    Feb 2002
    Posts
    403
    I have the listboxes working. I have used an alternative approach of writing sql statements which are selected based on categorytype. I then manipulate the column counts, widths and so on from code to suit. This part is working well.

    However, the contact type expands. For example since intial install the contct type has had added consulting engineers.

    I am trying to think of a way that the user can write a quassi sql statement and therefore customise the list contents to acheive a different oputcome of the listbox.

    My thoughts were something like:

    1: Set up table for contacts to include the sql statement for the listbox.

    2: Set up an editor of some sort to write new sql (The bit I need help with)

    3: Populate the listbox using the sql statement by looking up at runtime based on category type.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •