Thursday, August 19, 2010

Making a multi-selection list box in Access 2003?

I am new to using MS Access, and I am trying to create a clinical database for my research. On the medical history form that I have created, I'd like to include information about whether the patients have the specific infection(s) that I am looking for in the past month. I want to make a multi-select list box that allows selection of more than 1 infection. I tried using a listbox wizard to do so. My control source is Infection in the Past Month; the row source type is set to value list, and row source includes "cold"; 'flu"; "sinusitis"; "bronchitis"; "pneumonia", "meningitis"; "urinary track infection". I also set the listbox as simple multi-select. But when I tried selecting those values, nothing showed up on the text field. I know that I need to write VBA code to do so. Could somone help me with writing the code, and where do I write the code? Thanks a lot!!!

Making a multi-selection list box in Access 2003?
You have to have a button or some kind of event, that after your selection triggers the code to execute a loop.





Basically you do a for loop through the list box and add only the selected values to your text box. Check out the example link.

broken teeth

No comments:

Post a Comment