Remove Selection From List Box

Nov 18, 2004

I have an unbound list box that gets its data from a query. I have a button that grabs the selected item(s) from the list box and puts them in a text box. The code for the button is:
Dim nsrow
Dim mystring
Me.List40.SetFocus
If Me.List40.ItemsSelected.Count > 0 Then
For Each nsrow In Me.List40.ItemsSelected
mystring = mystring & Me.List40.Column(2, nsrow) & ", "
Next nsrow
End If
If Right(mystring, 2) = ", " Then
mystring = Left(mystring, Len(mystring) - 2)
Else
End If
DESC = mystring

How do I make it so that when the item is selected and is in the text box, it prevents the user from clicking that same item again from the list box? The best way I think is to remove the item from the List box once it's in the text box but I don't know the code to do it.

Please Help!

View Replies


ADVERTISEMENT

Remove Names From List Box Upon Selection

May 6, 2005

I have a list box that is filled from a table with names of individuals. What I would like to do is when one of the names is selected it will take it off the list and do this for all the names in the list until all are removed then will reset and have the names avaialble once again. Is this possible and if so how can it be done? Thanks.

View 5 Replies View Related

Forms :: Nomination Form - Combobox Selection List Not Updating After Each Selection

Oct 27, 2014

I am designing a nomination form (web database so no vba macros can be used).

The form has 3 combo boxes: cboStaffName, cboLevel, cboNominee.

The form is bound to the tblSubmit table where the submissions are populated.

I used a select statement:SELECT Staff_List.Staff_Name FROM Staff_List; to populate the combo box for the Staff Name selection.

This is the select statement to populate the job level combobox:

SELECT Staff_List.Level, Staff_List.Staff_Name FROM Staff_List WHERE (((Staff_List.Staff_Name)=[forms]![frmtest]![cboStaffName]));

The select statement to populate the combobox for the nominee combobox:

SELECT Staff_List.Staff_Name FROM Staff_List WHERE (((Staff_List.Level)=[forms]![frmtest]![cboLevel]));

The problem is that the staff_name in the first combobox is still found in the nominee combobox which should not be because a staff cannot nominate self. There is a field in the Staff_List called YesNo that should be activated for each staff that is selected so that the select statement on the nominee combobox can be updated accordingly to remove items with the field "Active"

How to get the checkbox selected for each corresponding staff.

Sample of the database has been attached.

View 4 Replies View Related

Forms :: List Box - Selection - Populates Next List Box

May 20, 2013

I am wanting to preempt data in list boxes

listbox1
Fruit
Vegetable

listbox2 (If Fruit Is Selected)
Apple
Banana
Orange

listbox2 (If Vegetable Is Selected)
Potato
Peas
Carrot

If Fruit is selected in Listbox1 - Then Listbox2 should have the options
Apple
Banana
Orange

If Vegetable is selected in Listbox1 - Then Listbox2 should have the options
Potato
Peas
Carrot

View 12 Replies View Related

Add/Remove Records From A List

Jun 2, 2006

(Been a while since I had a question.) I have a table that stores a list of paper forms. the fields are ID#, display name, doccument name, and a code to determine if its a Word or Excel doccument, or an access report. Works fine; the user can click a form name (on the Forms/Reports tab on the main menu form) in a list box, set the # of copies and print the form. There are cases when a group of forms is needed (client admission is one). I have made a group table containing: GrpID, Grp Name, formID. I would like my "Form Group Edit" form to have 2 list boxes; the left one containing the (short) list of available forms; the right one displaying what forms are already (if any) in the selected form group. My idea is to have add/remove controls to manage the right list. I know this "wheel" is already invented and would like to plagerize one that works. Thanks in advance for your help.

View 2 Replies View Related

Forms :: Remove List Item From Combo Box After Use

Sep 1, 2013

Is it possible to remove an list item from a combo box list after it has been used.

What I am trying to do is use a combo box that has a list of questions, after the user selects a question from the combo box list and answers the question when they reselect the combo box that question will not be seen again till the form is reloaded.

View 2 Replies View Related

General :: Remove Customer From List But Keep All Related Info

Sep 26, 2012

Let's say I have a list of customers. For each customer I have much more info on other lists (order list, personal info list, bank info list, and so on) - all are of course connected properly.

Now let's say a certain customer is no longer my customer, so I want to remove him from the customer-list. But, I want to move him to a different list - past-customers - so all the information that was related to that customer will remain so. In short, I want to remove from the customer-list without affecting the related data.

View 4 Replies View Related

Assign Employees To Task Then Remove Employee From List Of Available For Other Tasks

May 6, 2015

I need the ability to assign employees to a different task in each of four different timeslots on a daily basis. What I would like to do is as I assign an employee to a task in timeframe 1, I would like for them to become unavailable to assign to another task in the same timeframe.

For Example: Three employees to assign to three tasks at the 8 AM to 10 AM time slot.

Employee
Task
Time
Assigned

Emp 1, Emp 2, Emp 3
Task 1
8 AM to 10 AM
Emp 2-Task 1

Emp 1, Emp 3
Task 2
8 AM to 10 AM
Emp 3-Task 2

Emp1
Task 3
8 AM to 10 AM
Emp1-Task 3

It would be nice to set this up in a form where my person doing the scheduling can assign an individual to a task and that individual name disappears from the combo boxes, list boxes, or is "greyed-out" in a listing of employees available for the time period for the remaining assignments.

View 7 Replies View Related

Need Help With List Box Selection

Feb 22, 2005

I am new to Access(and self taught) so bear this in mind when you view my DB. (Any suggestions are appreciated)I am using Access 2003.

I have included a sample DB. What I need this to do is when you use the Fill Selection Form You can choose mulitple selection in the list box. When you click Done those you selected will show up in the right hand side subform where you can add quantities. I want this info to be stored as one "Fill". It would also be nice if while you are selecting in the list box a calculated field shows you the total weight you have chosen.

Can anyone help???? :confused:

View 1 Replies View Related

List Box Selection

Dec 15, 2005

Hi There

i have a list box on a form, which from a query provides four columns

the first column is the bound column and is the reference ID,
the second column is the reference
the third column is the reference type ID
the fourth column is the reference type

depending on the reference type, the reference is edited on a different form

how do i / can i code it that when i double click the list box, the correct form opens to edit the reference details with the reference ID as the linkcriteria,

i am okay with the linkcriteria, but not with the code for the correct form to open

thanks in advance

View 3 Replies View Related

Msg Box Based On List Box Selection

Jun 20, 2005

I have a form that contains a list box with 11 separate options. Within this list is the option named "None". My desire is to have a message box displayed when any option is selected other than "None". I have searched various threads, however I have been unsucessful nailing down my issue. Thanks in advance for the assistance.

View 1 Replies View Related

List Box Text Selection

Feb 7, 2006

A few weeks ago I had a post in which I asked how a user could type in the text value of a list of selections in a list box, and arrive to that selection.

Such as if they type in "A" then "B", it goes to "Abby" rather than "Aaron" then "Ben". It was answered that this was not possible in MS Access with a list box, so after that I basically told the users I would look into it more.

I have finally cleared off my desk and arrived back to this small issue.

I thought of the idea to add a Drop-Down Combo Box to the form. I could use the functionality built into the Drop-Down Box to allow them to type in the person they are looking for in the List. Then click a button labeled "Find" and it would take them to the correct person in the list box. They could then function as before.

I just could not figure out the code to put behind my "Find" button. I am not sure if you can do a "Goto record" against a List Box, or a "Find record" against a list box.

Has anyone run into this issue, and if so, was there a way to work around it?

Thank you,

T.J.

View 2 Replies View Related

Default Selection In List Box

Jul 17, 2006

So I have a list box on a form from which users can select which fields to display in a query... There is a default set of fields to display, which at the moment is hardcoded in the associated VBA (far from ideal). I was wandering if there is a specific way to open a list box with a number of values selected by default?

Many thanks in advance,
Bogzla

View 1 Replies View Related

Choosing A Selection From List Box

Dec 14, 2004

I have a list box that pulls data from a form. It pulls ProjectID and ProjectName. I want to be able to select one of the ProjectName(s) from the list and have it take me to a form for that ProjectName. I have one form for all the ProjectName(s), and want to be able to simple select one of the ProjectName(s) from the list and have access bring me to the right page of the form. Please Help! Thanks!

View 4 Replies View Related

Retrieve The Selection Value From A List Box

Jan 14, 2005

how can I retreive the value (and not the index order with listIndex) from a list box? I have a list-box based on a parameter query and I want to retreive only the selected record (in the list box) data from that query.

View 2 Replies View Related

Modules & VBA :: Last Selection List Box?

Apr 6, 2014

I have a form where I add a new event, and it gets added to a list box in another form, I was intending to select the most up-to-date record within the list box but it seems to keep selecting the old latest record and not the new record that ive added. I had tried to select the first record but then move to the last record hoping it would refresh but that still doesn't work.

This is the code I used below:-

Quote:

'Select last event record added to event list box
Me.lstPatientEvents = Me.lstPatientEvents.ItemData(Me.lstPatientEvents.L istCount - 1)
lstPatientEvents.Selected(lstPatientEvents.ListCou nt - 1) = True

View 1 Replies View Related

Query By Multiple Selection List Box

Jul 24, 2007

so i have two listboxes that have the values i want for the query parameters. I slightly modified one code i found so that i can query using one of them, however i cannot figure out how to get the second listbox to put criteria into another field. The working code i'm using is:

Private Sub Command_Click()
On Error GoTo Err_Command_Click

On Error GoTo Err_Handler
Dim varItem As Variant
Dim strCriteria As String
Dim strSQL As String


For Each varItem In Me.PartyBox.ItemsSelected
strCriteria = strCriteria & "counterparties.counterparty =" & Chr(34) & Me.PartyBox.ItemData(varItem) & Chr(34) & " Or "
Next varItem


strCriteria = Left(strCriteria, Len(strCriteria) - 4)

strSQL = "SELECT counterparties.[Counterparty Entity], Fund.[Fund Name], products.Product, combine.[Available?] " & _
"FROM products INNER JOIN (Fund INNER JOIN (counterparties INNER JOIN combine ON counterparties.[Counterparty ID] = combine.[company id]) ON Fund.[Fund ID] = combine.[fund id]) ON products.[Product ID] = combine.[product id] " & _
"WHERE " & strCriteria


CurrentDb.QueryDefs("1").SQL = strSQL


DoCmd.OpenQuery "1"

Exit_Handler:
Exit Sub

Err_Handler:
If Err.Number = 5 Then
MsgBox "Must Make A Selection First", , "Make A Selection First"
Exit Sub
Else
MsgBox Err.Number & " " & Err.Description
Resume Exit_Handler
End If


Dim stDocName As String
stDocName = "combqry"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Command_Click:
Exit Sub

Err_Command_Click:
MsgBox Err.Description
Resume Exit_Command_Click

End Sub



I am trying to be able to search by Product and counterparty.
Any help is greatly appreciated, thanks!

View 8 Replies View Related

List Box Selection Carried To Another Form

Jun 15, 2005

I have searched the forum and just can't find an answer. I'm hoping someone can point me in the right direction.

I have a main form with a combo box that links to a table called tblSTC. There are however hundreds of records to choose from. To make the serach more simple for the user there is a button next to the combo called 'Search', When the user presses this a new form pops up with a text box and a list box (the list box contains all records in tblSTC). As the user starts to enter text into the textbox an AfterUpdate event limits the records displayed in the list box to match the criteria of what has been entered in the text box.

When the user identifies the entry he/she wants to select from the list box, I want the functionality of being able to double click the entry, the popup form close and the selection populated in the combo box.

I know that this is probably just simple code using the List Box double click event. I am however unsure how to go about it. Do I need to use some kind of Insert statement??

View 3 Replies View Related

List Box Text Type Selection

Jan 12, 2006

I have an MS Access DB, that uses a list box to give users a view of the possible selections to choose among.

It works great, but the database has grown to the point there are nearly 3,000 items in the list box.

I found that if you type in the first letter, it will take you to the first alphabetically in the list with that letter.

So if I type in "A" it takes me to "Aardvark". But even this could use improvement, as typing in the first letter with 3,000+ selections means the users may scroll a few hundred to find what they are looking for.

Is there any code, or property setting that can set it up, so the users can type in the entry and it will narrow it down?

So if they type in "AS" it goes to "Assumption" rather than "Aardvark" then jumps to "Sail" (as it does right now).

Thank you for your help,

T.J. Bernard

View 3 Replies View Related

Combo Box And Selection Of Item In That List.

Dec 12, 2006

Hello,

Didnt know where to start or what direction to head in. I have a combo box on one of my forms. It works fine, but would am looking for an added feature.

I am looking to get the following started:

There are 5 items in the list of my combo box. If the user selects the item called "Lost Opportunity", then how do I get an additional combo box to show up underneath it with reasons the sales opportunity was lost.

Then the reasons why would be in the additional box and they would have to select one...my work wants it so that if they lose the sale, they must provide a reason for that loss of business.

Any help in a direction would be appreciated.

Thanks.

View 4 Replies View Related

Forms :: List Drops But Won't Allow Selection

Jul 10, 2013

I've been working on this application for a long time, and my combo box always behaved well before, but today I click on the combo box, the list drops down, but I can't select anything. I've also tried typing the item on the list into the combo, which normally works, but I'm not being allowed to type anything there.

View 6 Replies View Related

Modules & VBA :: Record Selection From List Box

Oct 18, 2013

I have a form that allows me to change the information for a list of personnel. On this form I have a list box that displays all the personnel in the list. There should never be more than 12-15 people in this list so it's an effective way of selecting records, however I can't figure out how to make the form select the record that is tied to that person from the list.

In VBA I've tried creating an "On Click" command for the list that, when a name is selected, is brings up the corresponding record. I thought I could use a DoCmd.FindRecord but I guess I don't quite know what I'm doing. I didn't want to use SQL to limit the records to just the one that matched I wanted to keep it simple if possible.

Code:
Private Sub Personnel_List_Click()
DoCmd.FindRecord Personnel_List, , True, , True
End Sub

The Personnel_List box is tied to the Personnel_Table, and the table only displays the names available.

View 3 Replies View Related

Forms :: Saving List Box Selection Set?

Aug 12, 2013

Is there an easy way to store a multiselect list box selection?

View 1 Replies View Related

Store Multiple List Box Selection In Text Box

Jan 11, 2007

I created a button that when pressed concatenates any items selected in a list box and places them in a text box on the form with the format of "itemselected1" or "itemselected2" or "itemselected3"

However, I need to set the criteria in a query to look at this text box and return the results based on that selection. When I do that I get no results even is the query should run fine with that type of format.

Attached is a copy of the Code for the button and the result
Dim txtValue As String
Dim varItem As Variant
Dim strlnameselect As String
Dim intCount as Integer
'Cycle through selected rows in listbox

For Each varItem In Me.Queueselect.ItemsSelected
intCount = intCount + 1
Select Case Len(txtValue)
Case 0
txtValue = Chr(34) & Me.Queueselect.ItemData(varItem)
Case Else
txtValue = txtValue & Chr(34) & " Or " & Chr(34) & Me.Queueselect.ItemData(varItem)
End Select
If intCount=Me.Queueselect.ItemsSelected.Count Then
txtValue = txtValue & Chr(34)
End If
Next
'Assign variable value to textbox
Me.Queuetorun.Value = txtValue

End Sub

the result in the text box is
"A" or "B" or "C" or "D"

View 3 Replies View Related

Wizard Style List Selection Interface

Aug 15, 2005

I would like to create a "wizard style" interface to allow users to Select items (staff members) by moving them from a list of "available" staff to a list of "selected" staff (and back again if they change their minds :rolleyes: ). - e.g. Like the Report Wizard, where you move table/query fields between the "Available Fields" and "Selected Fields" lists.

Does anyone have anything to help me out with this, that they could "lend" me ?

Of course I am stuck using AC97.... so I may need to borrow a hammer and chisel as well :D

View 1 Replies View Related

Using 2 Combo Boxes - 2nd One List Depending On Selection In First

Sep 23, 2005

(pls see end of thread for further clarification)

Hi

I am trying to achieve the following using 2 combo boxes

Box "a" is a list of courses from tbl_training_courses. The user selects the appropriate course.

Box "b" is a list of dates for each course from tbl_course_dates. Thus the user can select which date per course they want to book someone onto, and this value is then stored in tbl_training_record as the date the person is booked onto.

Its not working!!! It either displays blank values, or it starts a parameter query which I didnt want.

In the combo wizard, access refers to "remembering the value selected for later use" - i guess this might be what I need to use, remembering the value from the first and using it to select rows for the 2nd box based on identical courseID - but I can't seem to find this in Help file.

Any ideas anyone?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved