Get a Jumpstart with our Sample Apps
Results 1 to 21 of 21

Thread: Display List Box Results

  1. #1
    Member
    Real Name
    Diana Crissman
    Join Date
    Jul 2008
    Posts
    140

    Default Display List Box Results

    I set up a form with two buttons, each pulls up a separate list box according to the selection chosen. Is there a way that I can display these results on the same form in text format?

  2. #2
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,110

    Default Re: Display List Box Results

    Diana,
    I believe some more description/explanation is needed. At least by this sole.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  3. #3
    Member
    Real Name
    Diana Crissman
    Join Date
    Jul 2008
    Posts
    140

    Default Re: Display List Box Results

    I attached a better picture of the form I'm working on. When you click on the Dr Requests a listbox comes up with certain choices and when you click on the Hospital Requests a different listbox comes up. What I would like to do is have the results from the listbox populate a text box that shows at the bottom of the form. This may not even be possible....

  4. #4
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,110

    Default Re: Display List Box Results

    Want to have text box show below the Comments box that displays the results from the list box.
    OK, place a text box below the Comment field. The default object name will be text1. Put this code after the list box step:

    parentform:text1.text = your_list_box_variable

    But I am still not quite clear on what you are trying to do. Do you want to just see the choice made by the user immediately after it is made and not be a permanent field value? Because the text box value will not be permanent. Another temporary way is to place that variable as a field on the form from the DragDrop list to display it's value. It will be a temporary value also, however.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  5. #5
    Member
    Real Name
    Diana Crissman
    Join Date
    Jul 2008
    Posts
    140

    Default Re: Display List Box Results

    Hi Mike, thank you so much for your help.

    In your reply you said to "Put this code after the list box step:" So sorry, I don't know where that is, could you please explain? My expertise level is more towards the beginner level...but I'm trying like crazy to get to intermediate!

    To answer your question "But I am still not quite clear on what you are trying to do. Do you want to just see the choice made by the user immediately after it is made and not be a permanent field value?" I think the answer is "yes" but let me ask you this, if it is not a permanent field value will those choices from the list box (there will be more than one) display if that patient record is called up at a later time?

    Do you think I should go about this differently?

  6. #6
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,110

    Default Re: Display List Box Results

    A text box object is part of the Form object, not part of the table record. In the text box properties, the value that is listed under Text in the Setup tab is what will display as the text box default in the text box until it is changed. The code I supplied makes that change. When the form is closed and reopened, that default text box property value will be the text displayed. It is not connected to any record.

    I am sorry, but it still gets back to what you need, and what you are trying to do. With a more thorough explanation, then I can help more thoroughly. Right now, I'm just guessing. You have to help the folks on this board help you by giving enough details to develop a cogent understanding of what you are trying to achieve. When folks don't chimed in within a short time, it is often that the posting is undecipherable of contains insufficient detail to even start to develop an answer.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  7. #7
    Member
    Real Name
    Diana Crissman
    Join Date
    Jul 2008
    Posts
    140

    Default Re: Display List Box Results

    If you look at the document I attached in my second post, it shows a picture of the form I created. I had followed the directions in the help section of A5 to create buttons (Dr Request and Hospital Request) that use Action Scripting to display an Xdialog box. In that process I defined the Xdialog box as a Check Box-List Box dialog box that displays the choices that are shown in the second picture in the document that I attached (that one is only for Dr. Requests). When the user checks the appropriate selections, supposedly the user's selections are returned as a CR-LF delimited list in the variable created. For the Dr. Requests the variable is named "DrRequests".

    What I am trying to do is have that delimited list (which ends up in the DrRequests variable) populate another box/form/browse (it doesn't matter) that is displayed on the same form but is permanent in that you can come back to this record and see those selections. Because there are so many choices I didn't want to have them all displaying all the time. Also, the choices the user selects are not retained in the Xdialog box so when I go back to that record they are not there.

    Is this any more clear? What you had suggested before populated the text box but as you said, its only temporary and is lost once you leave the record.

  8. #8
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,110

    Default Re: Display List Box Results

    Bravo Diana,
    Excellent! You have used the exact terminology needed for me understand the composition of the output variable content and that you wish this to be available "permanantly". This means it needs to be incorporated as part of the (a) record.

    Now, the crlf() delimited list. The values in that list based upon the picture could have 3 items - Entire chart, Progress Notes, Lab Results. Are the values in this list going to be used in any manner individually or as a whole to generate some other action (computer action) or is this list simply a visual cue to the user?

    If the list items are to be used for further action, then they should probably be 'stored' as independant record values, like in an additional field. The crlf list could be converted to a linear comma delimited string, using the function crlf_to_comma() and deposited as a field value. From this, that value could be a visual cue and/or a source for further processing.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  9. #9
    Member
    Real Name
    Diana Crissman
    Join Date
    Jul 2008
    Posts
    140

    Default Re: Display List Box Results

    LOL, bow taken! I apologize for my "unspecificity", its not my best trait.

    Now, the crlf() delimited list. The values in that list based upon the picture could have 3 items - Entire chart, Progress Notes, Lab Results. Are the values in this list going to be used in any manner individually or as a whole to generate some other action (computer action) or is this list simply a visual cue to the user?


    Simply a visual cue to the user but it would be something that should be available to add to a report. I'm assuming this would be done in the same fashion any report is designed, and that's by adding the field to the report.

    The crlf list could be converted to a linear comma delimited string, using the function crlf_to_comma() and deposited as a field value. From this, that value could be a visual cue and/or a source for further processing.

    I follow what you're suggesting, just have no clue how to accomplish it. I checked the help file but its very lacking.

    Is there a sample somewhere? I looked at the Alphasports sample without any luck. I attached a zip of my project, if you wish to look at it. Its the Med_Records form that I'm fighting with. If you open it and click on Dr. Requests you'll see exactly what its doing.

    Med_Records is the parent form. DrRequests the variable output. The result variable is varC_result. I really appreciate your time and any direction you can give me.
    Last edited by kyosadls; 05-08-2009 at 12:13 PM. Reason: Update zip file

  10. #10
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,110

    Default Re: Display List Box Results

    Diana,
    Thank you for the example. It actually generated the understanding there is a BUG in the output variable for the Check Box-List Box. Your s included advanced formating. All the advanced formating code was becoming integrated in the output variable for the dialog user choices. You did not see this or realize this, but it came to light whaen I began playing with it. I reported it.

    I am bushed and I will get back to you in the morning.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  11. #11
    Member
    Real Name
    Diana Crissman
    Join Date
    Jul 2008
    Posts
    140

    Default Re: Display List Box Results

    Hi Mike, I did notice that, and thought I mentioned it, but figured that was the least of my frustrations as it could be addressed with another snippet of code. I'll play with that, take out the advanced formatting perhaps, although the client is particularly fond of larger fonts and the color blue (in case you hadn't noticed).

  12. #12
    Member
    Real Name
    Diana Crissman
    Join Date
    Jul 2008
    Posts
    140

    Default Re: Display List Box Results

    I tried a couple ways to take out the formatting, one via the font settings of the text box itself, but I think it goes back to the stylesheet because it still shows the code (such as {B=}) even if there isn't any advanced formatting.

    I was trying to play with the format_data() code, just not sure where to insert it.

  13. #13
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,784

    Default Re: Display List Box Results

    This seems to work
    Code:
    DrRequests = *for_each(ln,word(ln,-1,"}"),DrRequests)
    Tim Kiebert
    Geelong Citrus Packers
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  14. #14
    Member
    Real Name
    Diana Crissman
    Join Date
    Jul 2008
    Posts
    140

    Default Re: Display List Box Results

    Hi Tim, thanks for hopping in. Where are you adding that code? I put it after Med_Records:text1.text and I get

    Med_Records:text1.text = DrRequests not found
    Med_Records:text1 not found

    (Med_Records is the form, Text1 is the name of the text box) Should I define a separate text box?

  15. #15
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,110

    Default Re: Display List Box Results

    Diana,
    Here is your example back to you. I have the database properties to open the medrecords form for convenience of this example. To the medrecord table I added a field Requests,C,255. To the Medrecords Form I added this field. I added two Inline xbasic action scripts to your Dr. Request button. The first simply dims the dialog variable to be empty. The second includes Tim's clean-up removing the checkbox format garbage within the output variable, and writing the variable value to the requests field. Now you have the request in a field available for permanent use.


    I didn't know which form you were actually using, so I also wrote into the xbasic in the button on the Med_Records Form and added the Request field to that Form so that button would work.

    Hope that helps.
    Last edited by Mike Wilson; 05-09-2009 at 02:50 PM.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  16. #16
    Member
    Real Name
    Diana Crissman
    Join Date
    Jul 2008
    Posts
    140

    Default Re: Display List Box Results

    It never ceases to amaze me at the generosity of the members in this forum to donate their time and knowledge to the alpha5-deficient such as myself. This was probably one of the best Mothers Day presents I've had! :D Now to dissect it and understand it.

    I hope I can someday return the favor - thanks so much to both of you!

  17. #17
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,298

    Default Re: Display List Box Results

    I hope I can someday return the favor
    This is what keeps the message board vital. It's too bad the vast majority of users just drop by when they need something... If more dropped by to lend a hand to others, the message board would be even better!

    -- tom

  18. #18
    Member
    Real Name
    Diana Crissman
    Join Date
    Jul 2008
    Posts
    140

    Default Re: Display List Box Results

    Hi Mike! I have the form working as it should (thank you, thank you) but I have a question. In your sample, when the xdialog box comes up it displays all the choices and you can see them all as you select the items requested, wherein mine only shows the first 3 with scrolling enabled. How did you get the xdialog box to be larger lengthwise? I can't find anything in the formatting that addresses this. I tried adjusting the font but it doesn't make a difference. I looked through the system settings but no luck.
    I put snapshots of each sample in the attached document -- pls look if you have time, not a big issue.

  19. #19
    Member
    Real Name
    Cliff Wenger
    Join Date
    Jun 2006
    Location
    Sacramento, CA
    Posts
    38

    Default Re: Display List Box Results

    Diana,

    Edit the "on push" event of the Dr. Requests button and change the following line:

    Please choose items needed:| [%d;O={@@}%.40,5DrRequests^$$a_DrRequests];

    To:

    Please choose items needed:| [%d;O={@@}%.40,18DrRequests^$$a_DrRequests];


    If you wish to change the height of the MedRecord button, then edit the "on push" event of the button and change the height from 5 lines to 18 lines.
    Cliff

    Coffee tastes better if the latrines are dug downstream from an encampment.
    - US Army Field Regulations, 1861

  20. #20
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,110

    Default Re: Display List Box Results

    Hi,
    What Cliff wrote was spot on for the xbasic code of this. For a look at he Action Script arena where this is achieved, see pic.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  21. #21
    Member
    Real Name
    Diana Crissman
    Join Date
    Jul 2008
    Posts
    140

    Default Re: Display List Box Results

    Sweet! I noticed that option in the xdialog box layout doesn't even show in the layout when set up as an action script. So, in order to do specific tweaking you need to convert the action script to xbasic... got it! Thanks Cliff & Mike, much appreciated as always. Its little things like this that make the users a little happier!

Similar Threads

  1. How to Populate List box from sql query results?
    By christobal in forum Alpha Five Version 8
    Replies: 0
    Last Post: 09-04-2007, 07:26 AM
  2. How to display query results in a browse on form?
    By brett s in forum Alpha Five Version 7
    Replies: 0
    Last Post: 11-24-2006, 10:15 PM
  3. lookup - drop down list box results not correct
    By Rick Valenzuela in forum Alpha Five Version 6
    Replies: 3
    Last Post: 03-31-2005, 10:28 AM
  4. table lookup / display as drop down list box
    By Daniel Weiss in forum Alpha Five Version 5
    Replies: 4
    Last Post: 11-21-2002, 08:57 AM
  5. Dialog Box Record List Display Order
    By fairviewcomputing in forum Alpha Five Version 5
    Replies: 1
    Last Post: 10-18-2002, 08:31 AM

Posting Permissions

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