Create Multi-Select List box

How on earth do I create a multi-select list box?

I created a form, frmEditStudent.  Bound to a table, tblStudent.  the form 
is to record modifications that a student should receive according to several 
meetings that parents/administrators have.  The fields MathMods, ElaMods, 
SciMods, and SsMods will have multiple selections and their field type is 
number.

I created a listbox using the toolbox with a record source from tblMods and 
bound it to MathMods.  I set the multi-select to extended.

When I open the form and attempt to select multiple choices, no banana.  
Only 1 is highlighted and the value is not stored at all.

Any help would be greatly appreciated.
-- 
Thanks As Always
Rip
0
Utf
4/27/2007 9:48:02 PM
access.forms 6864 articles. 2 followers. Follow

3 Replies
1409 Views

Similar Articles

[PageSpeed] 42

On Fri, 27 Apr 2007 14:48:02 -0700, Ripper <Ripper@discussions.microsoft.com>
wrote:

>How on earth do I create a multi-select list box?
>
>I created a form, frmEditStudent.  Bound to a table, tblStudent.  the form 
>is to record modifications that a student should receive according to several 
>meetings that parents/administrators have.  The fields MathMods, ElaMods, 
>SciMods, and SsMods will have multiple selections and their field type is 
>number.
>
>I created a listbox using the toolbox with a record source from tblMods and 
>bound it to MathMods.  I set the multi-select to extended.
>
>When I open the form and attempt to select multiple choices, no banana.  
>Only 1 is highlighted and the value is not stored at all.
>
>Any help would be greatly appreciated.

A Listbox control has one and only one Control Source. You will need *another
table* to store the multiple values - you cannot store multiple numeric values
in a single field. Fields are atomic, and have one and only one value!

Don't confuse FORMS - which display and allow you to edit data - with TABLES.
Only Tables store data for later use. You need to get some more tables set up
before you start working on forms.

             John W. Vinson [MVP]
0
John
4/28/2007 12:15:42 AM
So why offer a multi-select option if you can't use it without other tables.  
 So I would need to create a table, call it tblMathMods, and store all the 
math mods in that table with a child/parent link of the students ID# in a sub 
form.  Then I can reporduce that information on reports as necessary.

What kind of coding do I need to use the listbox to write multiple records 
to the table or would it be better to scrap the listbox and just use 
continuous forms in the subform?
-- 
Thanks As Always
Rip


"John W. Vinson" wrote:

> On Fri, 27 Apr 2007 14:48:02 -0700, Ripper <Ripper@discussions.microsoft.com>
> wrote:
> 
> >How on earth do I create a multi-select list box?
> >
> >I created a form, frmEditStudent.  Bound to a table, tblStudent.  the form 
> >is to record modifications that a student should receive according to several 
> >meetings that parents/administrators have.  The fields MathMods, ElaMods, 
> >SciMods, and SsMods will have multiple selections and their field type is 
> >number.
> >
> >I created a listbox using the toolbox with a record source from tblMods and 
> >bound it to MathMods.  I set the multi-select to extended.
> >
> >When I open the form and attempt to select multiple choices, no banana.  
> >Only 1 is highlighted and the value is not stored at all.
> >
> >Any help would be greatly appreciated.
> 
> A Listbox control has one and only one Control Source. You will need *another
> table* to store the multiple values - you cannot store multiple numeric values
> in a single field. Fields are atomic, and have one and only one value!
> 
> Don't confuse FORMS - which display and allow you to edit data - with TABLES.
> Only Tables store data for later use. You need to get some more tables set up
> before you start working on forms.
> 
>              John W. Vinson [MVP]
> 
0
Utf
4/28/2007 4:10:02 AM
On Fri, 27 Apr 2007 21:10:02 -0700, Ripper <Ripper@discussions.microsoft.com>
wrote:

>What kind of coding do I need to use the listbox to write multiple records 
>to the table or would it be better to scrap the listbox and just use 
>continuous forms in the subform?

Continuous forms are easy, and require no code. If you DO want the
multiselect, here's some sample code you could adapt.

Private Sub cmdProcess_Click()
    ' Comments  : Update the AnimalCondition table based on the selections in
    '             the unbound multiselect listbox lstHealthIssues.
    '             Newly selected rows will be added to the table, newly
cleared
    '             rows will be deleted.
    ' Parameters: None
    ' Modified  : 01/29/02 by JWV
    '
    ' --------------------------------------------------
    ' Populate the AnimalCondition table with the selected issues
    On Error GoTo PROC_ERR
        
    Dim iItem As Integer
    Dim lngCondition As Long
    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    
    ' save the current record if it's not saved
    If Me.Dirty = True Then
        Me.Dirty = False
    End If
    Set db = CurrentDb
    ' Open a Recordset based on the table
    Set rs = db.OpenRecordset("AnimalCondition", dbOpenDynaset)
    With Me!lstHealthIssues
        ' Loop through all rows in the Listbox
        For iItem = 0 To .ListCount - 1
            lngCondition = .Column(0, iItem)
            ' Determine whether this AnimalID-HealthID combination is
currently
            ' in the table
            rs.FindFirst "[AnimalID] = " & Me.AnimalID & " AND " _
                         & "[HealthIssueID] = " & lngCondition
            If rs.NoMatch Then ' this item has not been added
                If .Selected(iItem) Then
                    ' add it
                    rs.AddNew
                    rs!AnimalID = Me.AnimalID
                    rs!HealthIssueID = lngCondition
                    rs.Update
                End If ' if it wasn't selected, ignore it
            Else
                If Not .Selected(iItem) Then
                    ' delete this record if it's been deselected
                    rs.Delete
                End If ' if it was selected, leave it alone
            End If
        Next iItem
    End With
    rs.Close
    Set rs = Nothing
    Set db = Nothing
    Me.subAnimalCondition.Requery
    
PROC_EXIT:
    Exit Sub
    
PROC_ERR:
    MsgBox "Error " & Err.Number & " in cmdProcess_Click:" _
           & vbCrLf & Err.Description
    Resume PROC_EXIT
    
End Sub



             John W. Vinson [MVP]
0
John
4/28/2007 5:36:05 AM
Reply:

Similar Artilces:

How can I get To-do's to show up in the Today screen Task list?
Hi, I am a new Outlook user, and have recently run into a problem in that I missed doing some things I had made "To-Do" to remind me to do. Unfortunately, I assumed that the Today screen would show my active "To-Do's" but I realize it only show's "Tasks". I'm a unclear what the difference is. Is there anyway to integrate them so they both show up on the Today screen? Why are they in different folders? Thanks for your help. Ed Outlook 2007? They are on the To-do Bar... it's replacing Outlook today because few users use it. The to-do list ...

using one combo box to determine content of a second combo box
Hello, I have been trying for several days to figure out how to use one combo box to determine the content of a second combo box. I am creating a database listing equipment by manufacturer and model # I would like to create one combo box that gives a drop down list of manufacturers Then, based on the manufacturer chosen, I would like to have a second combo box which gives a drop down list of model #'s offered by the chosen manufacturer It seems like a fairly simple concept, but I have poured through the "using access 2003" guide with no luck Access version I'm using: 20...

Combo Box Search Time
Hello Group, I have a combo box that I currently use with the Auto Expand feature on. This combo box points to a field in a query with 400,000 records. The box works fine but has about a 30 second latency delay from the time it gets focus to the time where it will display the records. I would like to cut this latency down to as little as possible. As a side note, I have 2 forms each with a combo box pointing to 2 different queries each with 400K records. The first combo box is a zip code lookup and works super fast; the moment you click it the results pop right up. The second combo box ...

auto fillin box for e-mail show deleted addresses ... how do I get rid of them?
I go to create a new e-mail (with Outlook 2007) and fill in the 'To' field with one alpha character. I see a drop down box (to speed things along) but at least one of those 'suggestions' is not valid; that particular address does not exist. It did exist at one time though. How do I flush out those helpful though inaccurate\old e-mail addresses? Thanks, DH either select it using the arrow key and press delete or delete the nk2 cache file. http://www.outlook-tips.net/archives/2006/20060823.htm -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24...

Filter List for Linked Values
I have a list of Numbers. In that list some Cells are: - Linked Values [ e.g. ='[Sales.xls]Sheet1'!K61) ] - Forumlas [ e.g. =1802+254+356 or =sum(A2:B32) ] - Manually Entered I want to filter the list for linked values. Is this possible? Hi not without VBA (using a user defined function) and a helper column >-----Original Message----- >I have a list of Numbers. In that list some Cells are: > > - Linked Values [ e.g. ='[Sales.xls]Sheet1'!K61) ] > - Forumlas [ e.g. =1802+254+356 or =sum(A2:B32) ] > - Manually Entered > > I want to filter the l...

Cannot create credit card account
I have a credit card account with a bank. I'm trying to set up an additional credit card account with the same bank, but Money won't allow it. I get the following message: ================ The service that allows you to download transactions from MSN Money My Accounts has been disabled. Close and reopen Money. If the problem persists then try turning the service off and then re-enabling it. If the problem still persists you will need to re-enable the service with a new Windows Live ID. ================ Naturally, restarting Money has no effect. Nor does restarting Windows. I...

For Roady Re Post Of Information Box at Startup
Hi Roady Your message was unavailable could you reply again to Oringinal Message On some computers running NT4 and Exchange 5.5 with XP pro Clients A message box appears about macros added to additional files, why does this box appear? and how do I stop it from appearing every time I sart Outlook 2000? Alright, here is the repost Please state the full error you get. You can control macro's in Outlook by Tools-> Macro-> Security -- Roady [MVP] www.sparnaaij.net Microsoft Office and Microsoft Office related News Also Outlook FAQ, How To's, Downloads and more... Tips of th...

dynamic forms (i.e. form with hidden text boxes, calenders etc)
I have one form with 25 different text box, calenders and selection boxes on the are all hidden except one showing at a time (its being used for users to entered data). I need to put a progress bar, but as the number of input choices changes dependant on what the user enters, its not as simple as '1 of 25' the other idea is to put all the 25 catorgories on one side of the form and then display what the user has entered as they go along. (problem here is that it means 25 new text boxes !!) any one got any other ideas? This would be very hard as you stated you never know how man...

including data in combo box ??
Please help I need to include a price list in a combo box for selection. I want to pick it from a combo box and then enter the information in a cell Thanks Hi, Manny Try this: Menu Data > Validation > list I hope this hepls. "Manny" <manny@mdrsolutions.co.za> escreveu na mensagem news:e4adkk$pn5$1@ctb-nnrp2.saix.net... > Please help > > I need to include a price list in a combo box for selection. > I want to pick it from a combo box and then enter the information in a > cell > > Thanks > ...

Binding a Combo Box
Is it possible to bind 2 different columns of a combo box to a table? If so, can I bind those 2 columns to 2 different tables? Secondary Question: Is it possible to bind an entire record of a combo box to a table/query? If any of these are possible, how do you do that (the simpler the answer, the better.) Thank you A combo box can only have a single bound column. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) <pcstechnical.sfhs@gmail.com> wrote in message news:1190743242.886152.75330@y42g2000hsy.googlegroups.com... > Is it possible to bind ...

Two multi-select listboxes
Dear honoured Expertise, I=B4m struggling with the syntax below. My setup is a form with two multi-select list boxes. A button click sends the details to a label print out. I can get them to work separately but when I try to combine them into a single query I run into troubles. The line "qdf.SQL =3D strSQL" fails me. The script frame work is from the net and adapted for my purpose. Perhaps someone can explain why the line "strCriteria =3D Left(strCriteria, Len(strCriteria) - 3)" is needed? Any advice would be most grateful. Private Sub Kommandoknapp32_Click() Dim db As DA...

creating a macro that will paste a value and then move
Please, help! I am trying to recreate a macro that opens a workbook, goes to Sheet 1, pastes clipboard info into A1, then moves to B1, then saves and closes the file. I know how to make the file automatic and how to get it to open and close (Auto_Open), but I cannot remember how to get the macro to move from cell to cell (left-to right). What happens is that when I do a recorded macro and then try to rerun it; it will paste into A1 and then will tab over to B1. Then upon the next time that I call up the spreadsheet, it will even paste to B1, but will not move further from that spot. I then...

Multi-view selections in one chart.
Here is my goal... I would like to be able to select a pull down with sorta lookup of e.g A, B, C, etc. program which reside on differen tabs and be able to select program A and the chart shows stats for A Next go to pull down and select B to see B's stats and so on. All whic will show up on one chart. I would also like to be able to have selection to show all A, B and C in one image on the chart as summary. I am not strong at VB but understand code. I have created summary and each individual chart as needed but would like it to rollu into one chart. Any ideas?? :eek ------------...

SQL Optimized
Integration Manager - SQL Optimized - GL Transaction Adapter only allows functional currency transactions to be integrated. To integrate Multi currency transactions you cannot use this and have to use the standrad adapter, which is extremly slow. ...

List Box and Updating the table
I want a form with 24 list boxes that the user can have multiple selections for each box..I understand that I need to have a table that will hold results and a new row for each selection, what i need to know is how do i get the data from the List boxes populated into the table? Thanks. Lisa, there are several problems with this. First, You will have to open the form on Friday and come back Monday to actually see it. I once tried a form with only 8 list boxes and it took 2 to 5 minutes to load the form. It has to retrieve the data from the database for each list box, one at a time. ...

new address lists not showing up in outlook client
Hello, for some reason any new address lists i create now do not show up in the outlook address book. please point me in a direction. Thanks Jon Is the client running Outlook 2003 in cached mode? "jon" <jgreen@alro.com> wrote in message news:340401c47ee8$d1914ed0$a301280a@phx.gbl... > Hello, > for some reason any new address lists i create now do not > show up in the outlook address book. please point me in a > direction. > > Thanks > Jon yes 2003 cached mode! >-----Original Message----- >Is the client running Outlook 2003 in cached mode? ...

Changing Account selection after typing email message
Outlook 2007: 1. My default account is KW1. 2. I start a new email. 3. I type the text of the email. 4. Before sending, I select the Account button and change to account KW2. 5. MY ENTIRE EMAIL MESSAGE IS LOST! THE ENTIRE TEXT DISAPPEARS!! The TO and SUBJECT remain, but that's it. By changing the FROM with the Accounts button, I lose the message. 6. I lose the will to type. Please help. you are typing in the signature panel. Edit the sigs so the first line is -- (2 dashes). This will help you see where they start so you can type above the line. -- Diane Poremsky [MVP - Outlook]...

Only run if check box is checked
I have some code that I only want to be run if a check box is checked. So I inserted an ActiveX check box which I have named cbRecord. I then put the following IF around the code which is initiated by clicking a spinner form control: If cbRecord.Value Then .... .... .... End If However, when the code is run I get the following error: Run time error '424': Object required. When I go to debug, the code doesn't even know that my check box exists. TIA...Geoff Try If Sheets("Sheet1").CheckBoxes("Check Box 1").Value = xlOn Then '...

Selecting rows from various sheets #3
That's pretty much what I want, but I want the function to select al the relevant columns and not just 1 column. Shan -- sha ----------------------------------------------------------------------- shav's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1198 View this thread: http://www.excelforum.com/showthread.php?threadid=26665 Hi then just add some more VLOOKUPs. One for each column of your source sheet -- Regards Frank Kabel Frankfurt, Germany "shav" <shav.1dodta@excelforum-nospam.com> schrieb im Newsbeitrag news:shav.1dodta@excelforum-...

Filtering a combo box...
Hi, I have a combo/dropdown box that shows all my customers (2000+) but obviously its difficult to find the exact customer i want.. The textbox part of the combo box will go to the first entry as i type which is ok but i would like it to filter down to show only the people that match what im typing as i type it.. for example i type "w" and the combo shows.. David Williams Walter Jones William Smith then i type the 'i' and get David Williams William Smith is this possible with a combo box? how come my inbox is not is not set in my left colun,and my delete word...

Excel Waiting List Help
I could use some help with an Excel Waiting List I am trying to create. My first column A is labeled Date and I formatted it as date. I have typed in 6/1/07 in A-1; I would like it when I type in in A-2 “6” the 1/07 is filled in already for me. The reason, this is a log of calls and there may be more than one entry call for that date. (Lazy typer) Also need help with column C. If in C-1 I type in Smith as the last name I would like it to type in for me “_mith” in C-6 if I type in S. Reason, this would tell me that person already called that day or in the past. Sounds like it might not...

Don't want to repeat a selection
I have a sheet for a sports team. When making the lineup I select the players from a drop down list. How do I format the cell to not repeat a name that is selected in a cell? Take a look here: http://www.contextures.com/xlDataVal02.html In article <0057298B-9990-433C-86E5-746B26D4CE18@microsoft.com>, "gcheatwood" <gcheatwood@discussions.microsoft.com> wrote: > I have a sheet for a sports team. When making the lineup I select the > players from a drop down list. > How do I format the cell to not repeat a name that is selected in a cell? ...

Selecting the last figure in a row
Hi all, I cant seem to configure my offset function correctly to select the last figure in a row. I'm attempting to use the COUNT function to generate the correct cell reference dynamically but it doesnt appear to be working. Any help appreciated. DM -- DangerMouse ------------------------------------------------------------------------ DangerMouse's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=27755 View this thread: http://www.excelforum.com/showthread.php?threadid=534518 Hi Dangermouse, Try using Counta instead (check out the Help files for a ...

how to creat an outlook template 2002
i tried to follow the instructions posted on this website to emulate the out of office assistant. It suggest making an outlook template and using it in the rules wizard however, when i go to do it, there is no option to save as outlook template, just a document template. Do not use Word as the message editor when creating your template. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. After searching google.groups.com and finding no answer: alysa <anonymous@discussions.microsoft.com> asked: | i tried to follow the instructions post...

Cannot create exchange Mailbox using Active Directory
We are running WIndows server 2003, We have installed exchange 2003 as a new server over it. I have already made some users as recepient in the Active directory, but still (after 3 hrs) I am unable to see thier mailboxes in exchange system manager. I had used Active directory to create new users. We are also running SBS 2003 on it. You won't see mailboxes listed in Exchange System Manager until a) The mailbox has been logged into for the first time or b) The mailbox receives its first message -- Neil Hobson Exchange MVP For Exchange news, links, and tips, check: http://www.m...