Multiple Selection List Boxes To Add New Records

Aug 16, 2007

Hi! I hate to ask for so much help on this, but I'm lost.

I have a budget database that is used to track equipment for purchase. Many times, the same item (a desk, or chalkboard) is needed for more than one room, so I need to buy more than one. The way my form is set up, I put the detail about the chalkboard in and select the room ID for the room it is going into. The problem with this is that I don't want to have to do it for every single chalkboard location in the college.

So, I want to use a multiple selection list box to add the records all at once. In other words, I want to enter the item detail in my form, and then select all of the rooms that item is going into, and then click OK! and have it create new records for each room that item is going into. So rather than having one new record created (as would be with a combo box), if I have three rooms selected, I want the OK button to add the record to the table three times with a different room number for each record. Any ideas????? Thanks!

KellyJo

View Replies


ADVERTISEMENT

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

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

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

Forms :: Multiple Selection On Form (list Box)

Oct 8, 2014

I am trying to resolve a problem with selecting multiple records.

I have a table called T_user and bound form called F_user.

This form displays all 3 fields from that table.

When I want to add a new user, I enter a name and select a department.

Some of the users work for few departments, so here is the question:

How to select multiple departments for one user?

The department field in F_user is set to LISTBOX, and the multi select option in properties is set to SIMPLE.

I can select multiple departments, but as we know it won't save in the table, it will leave it as NULL value.

How can I save the record then? In another form I need to select users from specific department, so lets say A.Smith, need to be visible in those few selected ones.

I have seen this [URL] .....

form this post [URL] .......

but unsure how can I make it work on my form.

View 5 Replies View Related

Query To List Multiple Records In A List From Multiple Queries

Jul 11, 2013

I have a DB where you there's 5 tables all linked together by one project ID

tables below

Project , Staff, Asset, allowances, travel, mark up

What I can do is create a new project, then add records to each of the other tables on what different items I require,

i.e. I create a new project - called project one, in the project table I create a record stating, name, time scale, client and location, then I add different records to each of the other tables on what I require all linked to the same project ID. (probably not explained that too well)

Now I want to create a query that lists all the requirements one after the other this will make it easier to create reports and to calculate costing's.

At the moment I have made 5 different queries listing all the data, then have one report containing 5 sub reports to display the data, no this does work.

View 7 Replies View Related

Multiple List Boxes!

Mar 2, 2006

Is it possible to control the options available in one list box with an option made from a previous listbox? If so how do I do this?

Thanks

View 5 Replies View Related

Modules & VBA :: Inserting Multiple Records From Multiple Unbound Text Boxes

May 6, 2014

I have a form with 15 unbound text boxes (daily temperatures) and what I am trying to do after entering the temperatures into the text boxes the user clicks an add button which will add 15 new records into the temperature table

the code I have started off with is

Code:

CurrentDb.Execute "INSERT INTO ColdTemperatures (ProductID, ColdTempDate, Temperature) VALUES (" & Lettuce & ", #" & Me.RealTime & "#, " & Me.Lettuce & ")"

which adds 1 successfully however if i repeat the code above for all 15 this Im assumming will create a potential bottleneck and slow the system down

is it possible to add all 15 records at once? do you think Im going at this the right way

View 5 Replies View Related

Queries :: Drop Down List Selection - Move Records From One Table To Another?

Sep 15, 2013

Is there a way in which someone can select a table from a drop down list and then search that table for a record then move that record to another table.

For example.

User selects 'Mikey's_table' searchs for a record then move this selected record to 'Mandy's_table'

(all the tables have the same structure etc. identical apart from the name of the table and records within)

I have the list of tables that all the records will be on and the users will know which table the record is in, i basically need to know if there is an ability to search for a record over multiple tables then edit that record and move it to another Table.

I have tried to use a Union Query which works when searching but i cannot edit or move the record ...

View 1 Replies View Related

Modules & VBA :: Multiple Selection List / Comma Separated String - Run Query And Create Report

Jun 18, 2013

I'm using Access 2007.

So far I have a Multi Select enabled list on which the user selects the serial numbers they want. They then click the "Report" button which will trigger a query based on the selected serial numbers to create a report on those serial numbers.

I have the code for the multi-select list working already. It creates a string of comma separated values that are the serial numbers which are selected in the list. Somehow I need to pass this string to my query so it can use it as a filter.

Here is some of my code:

Code:
Option Compare Database
Option Explicit
Private Sub Form_Current()
Dim oItem As Variant
Dim bFound As Boolean

[Code] ....

Here's my current query in SQL:

Then finally how to I get the query to execute and create a report based on all of this?

View 11 Replies View Related

Multiple Selection Of Records

Dec 17, 2005

I'm building a database for a realtor friend. Part of his job is keeping track of where his clients want to live. I have added a field named "Areas". I need to populate that field with names of cities where his clients want to buy thier house. Sometimes there are only a couple of cities. Other times there could be more then 10. I don't want him to type these cities in. He is not a good typer, either am I, and he is prone to abbreviations and typos. Garbage in garbage out. I would like to provide him a drop down list, or something like that, of all the cities or areas and have him select each area and then either hit a command button or copy/paste it to that text box. Either way will work. The command button would be nifty. The result would give him the option of doing a form filter and being able to filter that text box for ex: "atlanta" and "syracuse". He then could cue these people when he has a property come available in either one of those cities.

I DON'T understand VBA code. I don't know how to write it or where to put it.

I tried to search this site and I could not find any threads like this, to my amazement. If there is a similiar post out there and I could not find it I apologize in advance.

View 1 Replies View Related

Multiple Combo / List Boxes - Sort Based On Entries

Sep 23, 2013

I am trying to put together a form where employees will be entering maintenance information into my database. One of the requirements for this data is that when they perform repair work on an asset, they have to list a problem, cause and remedy. These are codes that are specific to each asset.

The closest thing I can think of to what I am trying to acheive is the selectors on car search websites. You select a MAKE, and then the MODEL list is narrowed down based on that, then you pick the TRIM, which is narrowed down based on the model selection. I have an Excel spreadsheet of the Assets(Failure Class), Problems, Causes, and Remedies...I'm just not sure how to put this into Access to get the desired output. I have attached a sample of the Excel spreadsheet for illustration.

I believe I'm going to have to put each of the columns in a seperate table and use relationships..but I'm not sure about that.

View 2 Replies View Related

Queries :: Multiple Records Selection

Jun 13, 2014

I have a database that contains different departments per office location with the dept. codes such as 100, 101, 102, 103 etc.

I like to have a criteria in a query that will give me all departments that are running from one office location OR if I do not want one dept. to show in my query to be excluded.

Also, the way I currently set the parameters is, it is asking for the office location by state, county, city, address and department code. I set the department criteria as Not [Department] which excludes the dept. that I do not want to see in the query, BUT I also want to have an option that when I run the query to SEE all the departments.

Is it possible to have a criteria like that?

View 3 Replies View Related

Modules & VBA :: Multi Select List Boxes With Multiple Columns In Access 2013

Oct 22, 2014

I have a listbox set to Multiselect property of Simple. The listbox is populated by using a table. There are 4 columns in the listbox

Code:
1 3/23/2014 4/5/2014 2014
2 4/6/2014 4/19/2014 2014
3 4/20/2014 5/3/2014 2014

The columns are PayPeriod, StartDate, EndDate, FiscalYear

What I want to be able to do is highlight a chunk of dates and have the first selected StartDate and the last selected EndDate populate two hidden text boxes so I can use them for my queries/reports.

I've tried a couple different ways. Each time what happens is it only uses the last item I have selected in it's calculations.

Code:
Dim ItemIndex As Variant
For Each ItemIndex In Me.lstPayPeriods.ItemsSelected
If Me.lstPayPeriods.Selected(ItemIndex) And Me.lstPayPeriods.Selected(ItemIndex - 1) = False Then
Date1.SetFocus
Date1.Text = Me.lstPayPeriods.Column(2, Me.lstPayPeriods.ListIndex)
End If
Next

In this example I tried to have it go through each Item of the listbox. I wanted to check to see if the current row was selected and the row before it wasn't. That way I could determine it was the first item selected in the group of selected items. It would always only use the last item I had selected.

Code:
Dim CurrentRow As Integer
Dim FirstDate As Date
For CurrentRow = 0 To Me.lstPayPeriods.ListCount - 1
If Me.lstPayPeriods.Selected(CurrentRow) Then
Date2.SetFocus

[Code] ....

I tried to do something similar with this code. Again, it only uses the last item I have selected.

View 2 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

General :: How To Filter Records Using Multiple Combo Boxes

Jun 29, 2014

I have a table with the following 5 fields. (Service Type), (Valve Name),(Size),(Rating),(Description).

I want to do two thing:

First: I want to select the required information from the first 4 fields using combo boxes and get the last field (description) based on the selected 4 fields. In other words, i want the record to be filtered using first 4 fields to give me the last field info.

Second: I want to store the filtered record (all 5 fields) in another table.

View 6 Replies View Related

Multiple Combo Boxes In Form To Choose Groups Of Records

Feb 16, 2005

Hello,
I am wondering if it is possible to have several combo "boxes" in one form. The form is based on one table. In the table there are several fields which use a look-up (combo) drop down box to choose from: Type, Description, Manufacturer and Location.

In the form I want a combo box for Type, to bring up specific records in a subform, then I want a combo box for Description to bring up another set of records (within that Type of equipment) and a third combo box for Location to bring up all equipment within that location.

When I have tried to set this up - it changes some of the data in the in the subform - which changes it in the underlying table. If it set the form to open in New Record, then nothing shows up in the drop down box. Is there some If, THen code I could use to make it look first in the Type, then in the Description field, then close those out and look for the set of records that match in the location field?

Does that make sense?

I know how to manipulate in MSAccess templates, etc., but I don't know much about the underlying codes.

Thanks for any help!!!

View 1 Replies View Related

Using Multiple Combo Boxes To Retrieve (not Edit) Records From A Table

Mar 24, 2005

I'm creating a form that has combo boxes pertaining to each of the following fields from table "Documents": DocumentID (primary key), DocumentTitle, DocumentAuthor, and DocumentYear. No combo box is used with any priority over the others. The working form will allow a user to retrieve the full document record (data for all fields) by using any combo box they want, as well as any combination of combo boxes. This means that if a selection is made in one field's combo box, the drop-down lists in the other boxes need to update based on that preliminary selection. The filtered results for each field, based on any and all combo box selections, are always shown in a single datasheet on the form.

The kicker is that when a user starts filtering records by making selections from the drop down list in a combo box, but then decides to TYPE in another field's combo box, I want the combo box they typed in to do two things: 1) filter the records for that field based on what they typed, if any records meet that criteria (e.g. they typed "B" so only records beginning with B are shown), and 2) if no records match the typed criteria, the search starts all over (at the top of the cascade), filtering all library records based only on what they typed in the most recent combo box.

Does that make sense? Any tips welcomed.

I don't know how to cascade combo boxes in this way.

View 2 Replies View Related

General :: Search Records Based On Multiple Check Boxes?

Jan 3, 2013

I have a table of data regarding companies (contact info, etc). The company I work for provides these companies with up to 10 different products. On my input form, I have created 10 check boxes (and thus, 10 columns of Yes/No data in the corresponding table).

Each company has at least 1 product checked off, and up to all 10.

I would like to create a combo box that lists all 10 products, and upon selecting one, a list box then populates with the names of the companies (primary key) that use that specific product.

So, for example,

Company A buys CATS and DOGS from us
Company B buys DOGS
Company C buys CATS and ELEPHANTS
Combo box options: CATS, DOGS, ELEPHANTS

If I choose DOGS, then a list box gets populated with:

Company A
Company B

and when I click either of these, the record should be brought up for the respective company.

All of this should take place in the header of the form, while the form itself can be updated based on search selections.

View 3 Replies View Related

Multiple Records From A List Box

May 11, 2005

Ok, I'm sorry if this is somewhere else in the forum, but I can't seem to locate it. Here's my task:

I am writing an attendance program for an Ambulance Company, and I actually have a large chunk of it done. I have a text box for the date and a combo box for the type of activity. I have two side-by-side list boxes that lets the officers select peoples names and put them in the right side list box. The part that I need help with is: How do I add new records to the table that includes each of the members names, but all the same dates and activities.


Ex.:

John Smith 5/10/05 Meeting
Jane Smith 5/10/05 Meeting
Tom Jones 5/10/05 Meeting

I think that i need to write a loop, but my access programming is way out of shape. Any help would be appreciated, ladies and gentlemen

~Damon Vogel

View 4 Replies View Related

Use List Box To Assign Multiple Values To Records?

Jan 12, 2005

I hope the title actually conveys what I'd like to do.

I want to assign records on a subform to a group header on a form. For example, I have groups A, B, C, and D and I want the records on a subform to be assigned to groups A, B, and D. (The number of groups and their names will change so I can't simply use an "A," "B," "C" option box.) My idea is to have a Multi-Select List Box on the main form and choose all the groups to which the records on the subform need to belong. So I'd select the groups, enter the records on the subform, then create a another record on the master form and assign records to another group.

Is it possible to make this happen without a lot of programming?

View 2 Replies View Related

Modules & VBA :: Using List Box For Updating Multiple Records At Once

Aug 13, 2013

I have a list box populated with record ID's all of which need a date field updated. I have been succesful at using the list box to update single records, but am not sure how to transfer this idea to work with multiple records simultaneously.

The code i am using is:

Private Sub Command13_Click()
Dim i As Integer
Dim strSQL As String
Dim sMessage As String
Set db = CurrentDb()
Dim sTitle As String
For i = List10.ListCount - 1 To 0 Step -1

[Code] .....

View 3 Replies View Related

Modules & VBA :: Edit Multiple Records From List Box?

May 25, 2014

I have two table. Table 1 (assets) list all my assets etc. Table 2 lists all servicing for each asset.

I have a form which generates a list box of items that require servicing (once servicing has been completed on these items) I would like to update all records, in both tables. Table 2 with all the information about the service. and Table 1 with (only) the next service date.

I have set the list box to allow multiple selection and have used the following code to allow new records to be update in table 2 (which works). but I cant seem to get the code to edit one cell in table 1.

private Sub Command59_Click()
Dim strSQL As String
Dim db As DAO.Database

[Code].....

View 4 Replies View Related

Forms +List Boxes +Text Boxes With Formulas

Nov 8, 2004

I have a form with a List Box (List BoxA) that returns a value from a query. I then have a Text Box (Text BoxB) that uses the value from List BoxB and multiplies it by let's say 2. It works giving me the correct value but only becomes visible after I click inside List BoxA. How can I make it visible as soon as the form is opened? I tried refreshing the form data, didn't work and I tried a requery macro which didn't work either.

Thanks,

Lester

View 3 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

Use Multi-select List Box To Filter A Report With Two List Boxes

Nov 20, 2013

Allen Browne's "Use a multi-select list box to filter a report" solution, in particularly with two multi-select list boxes? The code works fine for me for either box so long as I code it for one box alone. Combining the two into one code results in a type mismatch error. I'm trying to use the code to pass the contents of both multi-select boxes as Where conditions to a report. Both boxes are based on number fields. To try to isolate the problem, I've removed Allen's setDescription and OpenArgs conditions. We're unfortunately still on Access 2003 as the company desires to squeeze every dime by using until end-of-life next year.

Code:
Private Sub cmdPreview_Click()
On Error GoTo Err_Handler
'Purpose: Open the report filtered to the items selected in the list box.
Dim varItem As Variant 'Selected items

[Code] .....

View 14 Replies View Related







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