Passing Multiple ListBox Selections To Subform
Sep 21, 2005
Using Access 2003.
I will have a ListBox on the form with “Multi Select” set to either simple or extended. I have a collection of documents which must be recorded in a database. Some documents may have only one author, but could have more. Same with the recipient or copied-to.
Ideally it would be nice to have the ListBox on the left, selected one or more from the list and then pass them to one of the three fields by a command button, sort of like:
cmdAuthorAuthor1
LISTBOXcmdRecipientsRecipient1; Recipient2
cmdCopiedTo Copy1; Copy2; Copy3
I would like to have all of the names selected from the ListBox as a string, but fully understand the problems associated with normalization. Other posts have suggested subforms. So, the question is how to select from the ListBox and then pass the possible multiple selections to discrete fields on a subform that would display, say three fields and which would get away from the normalization issues:
cmdAuthor [Author1] [ ] [ ]
LISTBOXcmdRecipients [Recipient1] [Recipient2] [ ]
cmdCopiedTo [Copy1] [Copy2] [Copy3]
The secondary issue will be that there will be subsequent names which are not found until actually in the process of document review which will create a need to update the ListBox, which I know is not akin to a ComboBox NotInList function.
If there are any thoughts or coding out there which will help, it’d be appreciated.
Lawguy
View Replies
ADVERTISEMENT
Jul 11, 2006
I have a listbox with about 8 different choices. i want to be able to query what is selected in this list box but I need to be able to select more than one choice so that my employees don't have to create multiple forms for the same item. Is there any way to select more than one option? It would help greatly even if I have to add code in VB I will figure out how to do it, thank you.
View 2 Replies
View Related
Apr 12, 2006
This must be pretty common but I cann't figure it out.
There is a listbox that multiple selections are allowed. This listbox is bounded with a table field. All selections must be stored. I don't mind if each selection is stored as a different record.
Any ideas?
View 13 Replies
View Related
Apr 13, 2005
Hi guys new here.
Here's what I'm trying to do:
I made a listbox in which get's it's source from a field in a table named Soft. The field is named Software1.
This field contains a list off software that could be installed on systems.
I allready can select multiple selections from the listbox but what I want to do is the following.
I want to press a button, and after I press the button I want that the selected Software is added to a new listbox which show the Software installed. The software in the second listbox would also be stored inside a Table so that I could print them out in Reports.
To simply explain what I'm trying to do:
SoftwareListbox >> Make multple selections>>Press button>> Adds selected software to InstalledListbox which stores in the softwarelist installed in a Table.
I really hope you guys understand what I'm trying to do.
And sorry for my bad english, should have paid better attention during English class ;)
View 11 Replies
View Related
Aug 29, 2005
Hi,
I have a simple order entry system working with a subform containing combo box where a client selects various products from a table. These are recorded in separate table which allows for subsequent updating of the orders placed.
Now I want to refine this so that the user may make multiple selections as it is a bit laborious making 'n' single selections via a combo based subform.
Only a list box allows multiple selections but I would like some guidance on how to store and be able to recall and update the selected items.
Thanks and Regards
Tony Randell
View 1 Replies
View Related
Feb 18, 2015
I am trying to get my VBA to filter the subform, as currently it does nothing! I have copied it from a source on another forum and at the end of the VBA it originally opened up the query.
However I am trying to tailor this query so that instead of it opening the query I can have a datasheet on the form that displays the filtered records..
There are 3 multiselect listboxes
Here is my code
' This code uses ADO and ADOX and is suitable for Access 2000 (and later).
' A reference must be set to Microsoft ADO Ext. 2.7 for DDL and Security.
Private Sub cmdOK_Click()
Dim cat As New ADOX.Catalog
Dim cmd As New ADODB.Command
Dim qry As ADOX.View
[Code] ....
View 5 Replies
View Related
Oct 23, 2013
I have a multi select list box which I am trying to use to open another form and apply a filter based on the user's multiple selections.
List box - lstCatergories
Main Form - frmSuppliersSummaryCategories
Subform on Main Form - frmSuppliersSummaryCategoriesSubForm
The Subform contains the text box CategoryID
Here's my code which nearly works...
Code:
Private Sub cmdFilterSuppliers_Click()
On Error GoTo Err_cmdFilterSuppliers_Click
Dim strWhere As String
Dim ctl As Control
Dim varItem As Variant
[Code] .....
My problem is that the control "CategoryID" is on the subform and I'm having massive problems trying to reference it. This is the part of my code that won't work:
Code:
DoCmd.OpenForm "frmSuppliersSummaryCategories", acNormal, , "CategoryID IN(" & strWhere & ")"
However; if I open the SubForm directly it works perfectly. I.e.
Code:
DoCmd.OpenForm "frmSuppliersSummaryCategoriesSubform", acFormDS, , "CategoryID IN(" & strWhere & ")"
To summarise... How do I reference the control "CategoryID" on the subform "frmSuppliersSummaryCategoriesSubform"?
View 4 Replies
View Related
Dec 14, 2014
Using a popup form
1. On my main form, I have a listbox, I would like to edit the values of the listbox.
To do this, I have a popup form with 2 listboxes, one to have the values of the listbox on the main form, and the other listbox with option values for the 1st
1) how to i pass the rowsource sql of the listbox on the main form to the listbox on the popup form
2) how on closing the popup form, do i update the rowsource sql listbox on the main form from the changed value of the popup form listbox rowsource sql
View 3 Replies
View Related
Dec 23, 2004
Hi,
I have a listbox from where i can make selections and generate a report for the selected values , the problem is the selections are limited to 28 selections, if i try to select even one more after that i get an error:
" Run time error '7769' "
" The filter operation was cancelled. The filter would be too long."
Now is there anyway to make this limited selection changed to a higher value or unlimited??? so i can select as much choices as i can , even all of them if i want? Does anyone have an idea , i looked throught the properties of the listbox but no help.
thankx,
solig
View 2 Replies
View Related
Aug 24, 2006
I have a form that has names with a subform with information. The contacts are in a list box and the subform (in datasheet view) shows the phone number/email/etc.. of the selected contact person. I am using the form as a quick look up of a persons information. Before changing it to a list box, it was previously a combo box, and everything worked fine. i was able to requery the subform and the cooresponding info for the person would come up. However, its now a list box and i am having problems with the code to make this happen. I have a different button sending the names selected from the list box to a report...and that works fine, but i am obvisouly missing something to make it work with the subfrm requery. Below is the code i got so far. Any help would greatly be appreciated. its driving me nuts!
Private Sub QuickLookup_Click()
Dim varItem As Variant
Dim strWhere As String
strWhere = "[memberID] = "
For Each varItem In Me.MemberID.ItemsSelected
strWhere = strWhere & Me.MemberID.ItemData(varItem) & " OR [memberID] = "
Next varItem
strWhere = Left(strWhere, Len(strWhere) - 17)
DoCmd.Requery "subfrmqryindividual"
View 2 Replies
View Related
Jun 12, 2006
I have two unbound multi-select listboxes that saves selection to their respective table. It works just dandy. However, whenever I go back to the same record, the listbox is blank and apparently I have to instruct it to "retrieve" the previous selection from the table using the PK as criteria.This is far as I can get, though this code causes several errors and I'm not sure what I need to put in as an array for "For Each" statement. If anyone can guide me how to retrieve the old selection from the table and displaying on listbox, that would be great.If IsNull(DLookup("[ClientID]", "[tblClientAccommodations]", "[ClientID]=" & Me.ClientID)) = False Then Dim RecCount As Integer Dim Index As Variant RecCount = DCount("[ClientID]", "[tblClientAccommodations]", "[ClientID]=" & Me.ClientID) For Each Index In Me.lstReasAcc Me.lstReasAcc.Selected = (DLookup("CommunicationID", "[tblClientAccommodations]", "[ClientID]=" & Me.ClientID)) Next iThanks in advance.
View 3 Replies
View Related
May 6, 2015
I have a training matrix that lists employee names and certifications on various operations. The objective is to choose an operation and run a query to display everyone who is certified on that op. There are additional variables.
Code:
Name EMP ID OP1 OP2 OP3 OP4 OP5
-----------------------------------------------------------------------------
John Doe 526261 C C C
Bob Doe 555622 C C C
Sheila Doe 066600 C C C
Okay that looks about right for the data itself. The listbox has all the ops, you choose an op and hit a button and it goes and finds everyone who has a 'C' in that op column and pulls their record.
View 14 Replies
View Related
Jan 29, 2014
I have a listbox which is populated by a query from a table.
I also have a sub which allows users to quickly select multiple items from the listbox (based on a pre-defined criteria) rather than scrolling through and selecting them manually / individually
The sub works fine but when it is finished, the listbox is automatically scrolled to the bottom (or, rather, to the last selected item)
I would like to have the listbox scroll back to the very top once all of the appropriate items have been selected.
(I could loop through the listbox items in reverse - or 'bottom-up' - in the code but that would only have the desired effect if the topmost item was selected. I want it scrolled to the top regardless of whether the topmost item is selected or not).
View 2 Replies
View Related
Jan 26, 2005
I'm trying to create a database where a single "Classification" field is populated by selections made in a multiselect listbox and I can't figure out how to do this. Any help people can provide?
Table 1:
Name_ID <pk>
Name
Classification
Table 2:
Classification_ID <pk>
Classification
What I want to happen is click on a button next to the Classification field (text) and a popup form with a multi-select list loads (this part is easy, of course). The user can select as many classifications as they want, click the ok button and each item selected then goes back to the first form and populate in the Classification field (seperated by commas or semi-colons).
This possible?
View 3 Replies
View Related
Apr 19, 2005
OK - I have seen the other posts where individuals are trying to select multiple items from a list box and have a field populate with the selections. I have not seen a clear explanation defining if this is possible.
Essentially, I want to be able to query on the field and search for multiple selections within that field. Any recommendations as to how this can be achieved?
My next question, is if the selections in a multiple instance field are separated by a comma or some other character what is the best method to query for multile responses. For example, if the following data is in the field 1,2,3 and I want to query on 1 or 2?
Regards,
PolarBear
View 3 Replies
View Related
Aug 11, 2011
On the first form I have a button with the following OnClick event :
Private Sub Rispondi_Click()
acbReceiveMail
On Error GoTo Err_Rispondi_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmSendMail"
[Code] ....
On the form opened upon click ("frmSendMail") I am trying to populate the "cboTo" combobox with the "txtFrom" value from first form. In the OnLoad event I have written :
Private Sub Form_Load()
Me.cboTo = Me.OpenArgs
End Sub
Anyway after clicking the button that should open "frmSendMail" I get a popup saying : "An expression you entered is the wrong data type for one of the arguments" (run-time error '2498') ....
View 7 Replies
View Related
Mar 14, 2013
How can I pass data (an employee's first and last name) to a report ? I captured the employee's name from the listbox, but can't seem to pass it to the report. The desired report will only have the employee's name and records for related fields on the report. The table (contains emloyees' history data), form name, listBox (contains employees' names), and variable (contains the employee's name) are listed below.
Table_Employee_Detail_History
Form_Employee's Reports
Report_Attendance_Report
stremployee (variable
View 14 Replies
View Related
Sep 3, 2014
I have a form where I do a search and find the correct auditor in the listbox from the AuditorTable. This form is opened from a master form where I have the same fields in the table (ClientTable). What I need is that when I find the one, I double click it and the records from that auditor is passed to the client table.how to use Dlookup.
View 14 Replies
View Related
Oct 3, 2013
How can I pass two (2) values to a saved query ? These values are in a form that has a listbox with two (2) columns. The name of the form is 'Previous Evaluation Form'. I'm able to retrieve the values from both columns of the listbox in the form and I've already created the query. Both are working fine, but can figure out how to pass the query's criteria to select records for 'Name' and 'Date' columns of the query. Below is what I had in the 'Criteria:' of the query. What wrong with the code that is placed in the query's 'Criteria:' ?
Forms![Previous Evaluation Form]![Individuals].Column(0)
Forms![Previous Evaluation Form]![Individuals].Column(1)
View 3 Replies
View Related
Aug 6, 2005
I hope I can form this question so it makes sense. I’ve been trying to figure out a way to do this, if it can be done at all.
Ok, imagine I’m making a database of widgets. In this database I’m creating a table of widget name, cost, weight, and color. This part is pretty simple.
Now, my widgets can come in many different colors. To accommodate this, I create a separate table for colors, let’s say red, green, blue, yellow and purple. I create a color item in the first widget table, and use the look up wizard to point it to the color table. This way on my forms I can select the color widget I want and have it all standardized.
This is where my problem comes in. My widgets can be multiple colors. How can I create a field in my widget table, to somehow reference that I can have a red and blue widget? So, when I query all my red widgets, I get the red ones and the ones with red in them?
Now, I could make an item in my widget table for each color and make it a yes/no field. But, my real problem is exponentially bigger than this so that isn’t what I want to do.
Thanks,
Joiry
View 5 Replies
View Related
Feb 14, 2006
How do I allow the user to select more than one answer in a combo box? It is a drop down menu with several choices. I'd like the user to be able to select more than one if desired and all choices would display when queried. Thank you much. :)
View 4 Replies
View Related
Oct 1, 2006
Howdy all, Ive got combo boxes, in a cascading style working well... but what id like to also have is a another dropdown list that shows the last 5 selected options (because often the data will be entered in batches and it should just save time)there is combo1 combo2 and combo3 If Sport is selected in combo1 then it displays combo2 with all the sports in it, so if golf is selected then the golf options come up in combo3 for example tiger, So id like to store Sport > Golf > Tiger Ive already got the value for Tiger being selected, so I can assign that easily enoughWhat id like to be able to do is store the name and its value in a combo box maybe showing the last 5 selections. Im just not sure what the best way to go about this would be, Should I make a table with say 5 rows? or is there a better way to go about it?Any thoughts or advice would be awesome,Cheers Ezy
View 3 Replies
View Related
Mar 23, 2005
I have a continuous form which selects records to view based on the stock number and the dates, beginning and end, entered by the user. This is based on query that gets data from several related tables. This is what is in the Row Source property of the combo box has in it: SELECT [qrywhobotit].[PROD_CODE] FROM qrywhobotit; don't know if that makes any difference to my problems.
The stock number is selected from an unbound combo box. The dates are selected from 2 unbound text box controls, one for start date & one for end date. I used the after-update event of the combo box and it filters the stock number. I also used the after-update event in the end date text control to filter the dates (from and to).
Question: How do I write the events so it selects the stock number for just the date range entered. I can get the stock number to get the correct records, but the dates are not selected, it shows all records for that stock number not just those matching the date range entered. If I comment out the stock number code, then records selected match the date range entered, I only see the dates I entered but it shows all the stock numbers, not just the one stock number entered. I can get the stock number to work OR the dates but not both at the same time. I think I need some sort of "and" condition, but not sure where/how to put it.
Here is the code I used.
Private Sub cbofindrecwhobotit_AfterUpdate()
' Find the record(s) that matches the control.
' DoCmd.ApplyFilter , "Prod_Code = '" & DblApp(Me.cbofindrecwhobotit.Value) & "'"
' Me.FilterOn = True
End Sub
The above commands are commented out, I tried moving it all to the after update event of the end date text box control - didn't work (see following code). It works fine if I uncomment it, but then the dates don't get filtered at all.
Private Sub txtwhobotenddat_AfterUpdate()
DoCmd.ApplyFilter , "Prod_Code = '" & DblApp(Me.cbofindrecwhobotit.Value) & "'"
If txtwhobotstartdat.Value = "" Then
Me.Filter = "FULFILL_DT <= date()"
Else
Me.Filter = "FULFILL_DT between " & _
"(#" & Me.txtwhobotstartdat.Value & "#) " & _
"AND (#" & Me.txtwhobotenddat.Value & "#)"
End If
Me.FilterOn = True
End Sub
2nd Question: There are lots of records for any one stock number. When I use the combo box to select the stock number, I see the same stock number repeated again and again in the list displayed in the combo box , instead of just one of each. I tried turning both the Unique Values and Unique Records properties to YES on in the properties of the query, but that didn't fix it. How do I fix the combo box to display just a list of unique stock numbers?
Thanks to anyone who can help.
View 1 Replies
View Related
Mar 5, 2014
I have a list of codes that I would like to select among 50,000 codes in MS Access Database:
I can easily find one code but I don't know how to select multiple values:
My Query is:
SELECT [Codes for District].DistrictID, Univ2012.Schoolid
FROM Univ2012 INNER JOIN [Codes for District] ON Univ2012.DistrictID = [Codes for District].DistrictID
WHERE IN [((Univ2012.Schoolid)= 415030301, 415030303, 415030306, 415030309)]
GROUP BY [Codes for District].DistrictID, Univ2012.Schoolid
HAVING ((([Codes for District].DistrictID)=15));
When I run this query it gave me Syntax Error in Where clause...
View 3 Replies
View Related
Feb 7, 2006
I keep thinking this should be pretty simple, but more than 2 hours searching through posts has revealed no answers, probably because the answer is too simple.
OK, I have an append query. I've created a prompt to enter the number of the record the user wishes to append, as it is usually one single record. However, I've recently run into a problem that now there is the possibility of needing to specify more than one record at the same time to be appended.
How do I change the criteria syntax to allow the user to enter two, three, or a dozen (if need be) different record numbers? They are not listed sequentially, so I can't use a "between" statement. I've tried separating the numbers by commas, quotes, and so forth, but can't get it to recognise the records.
Can anyone help please? Thanks in advance. :o
View 14 Replies
View Related
Sep 28, 2005
Hello -
I have an option group on a form, that has 4 possible options. I need to allow the user to select any combination of the 4 options, to be stored in fields in another table.
By default, the option group only allows one to be selected (hence the name "option"? ;) Maybe I should proceed a different way?
Help would be appreciated!
View 12 Replies
View Related