How do I get my combo box selection to display related results in a list box?
I have a many to many table structure for a contact list that relates many contacts to many costcenters. What I want is when the user selects a costcenter from the combobox the related contacts show in a list box.
I use the follwing code to filter a report based on the listbox selection on a form. Below is the code I use, the problem it will error if the results have an apostrophe in the string.
Private Sub FilterDesc_Click() Dim strWhere As String Dim ctl As Control Dim varItem As Variant 'make sure a selection has been made If Me.ListCarrier.ItemsSelected.Count = 0 Then MsgBox "Must select at least 1 Carrier"
Hey guys, I was wondering... is there a way to have a listbox display values associated with a parent form ID? in other words... say I have a customer with invoices associated with their name, I want to display a form for that customer with a listbox (or maybe even subform) containing the invoice IDs associated with their name. Right now, I've got: SELECT qryClientData.InvoiceID, qryClientData.InvoiceDate FROM qryClientData ORDER BY [InvoiceDate]; to display information in the listbox. How do I modify this to display ONLY Invoices associated with the Clientname on the parent form?
I hope this makes sense. I can clarify if need be, I am just completely stumped. thanks and happy holidays!
I have a report that displays the results of a query. The query and the report are both run from a submit button on a form. I use DoCmd.OpenQuery "name", followed by DoCmd.OpenReport "name". Due to slow network connection the query shows up before the form is displayed. I would like the query to be hidden or minimised. In other words, I do not want the user to see the results of the query, only the report.
i have a form porblem. I have a search form embedded onto my main form its really a listbox that when i click the records in it they display the record.
prob;em is that when i delete the record it still shows in the listbox
Okay then, after much trouble and confusion, I finally realized I need to use an Extended listbox in order to allow for multiple items to be selected from a list on my form (rather than the evil multiple selection combobox!).
However, now I am trying to figure out how to make one listbox (IndustryClassification) only be visible if the item "Industry" is selected in another listbox (TypeOfBusiness). Coding I can use for this in the AfterUpdate event of the listbox?
I have been designing a database and finally was making good headway. I have a junction table that references 2 tables (1-m) and the junction table creates an autonumber primary key that many tables will reference. I realized that the junction table could have duplicates. I did not want to use a composite primary key, but found that I could create an index that contained the unique combination of my foreign keys. No more duplicates. I thought things were looking up. I found out that it is a bad idea to use a combo box in dataset view to have look-ups to other tables. If it is a bad idea why have the option? It does make data entry easier. Anyway not my question. The other tables that refer to my junction table no longer show the values of the foreign keys, but displays an id number for my 2 columns.
Hello, please could anyone tell me if is it possible to have a combo box in a form that displays just the last 7 days? (from whatever today’s current day is) I need to be able to store this date that the user selects in a query/table(Currently I have a field named SHIFT_DATE that the user enters a date into this field, this field is bound/linked to a query)Ie a drop down list showing the dates like this:15/02/200614/02/200613/02/200612/02/2006& so on……ive used the following code in a query before to display records from just the last 7 days >=DateAdd("d",-7,Date())I thought maybe I could do something similar in a combo box but I’ve had no luck so far :-( any suggestions would be excellent. Thanks.
I have created a combo box on a form using the combo box wizard. The combo box is linked to a table, and the combo box user's selection is supposed to be entered into a table so I can use it in reports, etc. The form works great. However, when I go to the table field that is supposed to have the newly entered combo-box selection, it contains only the record number, not the field contents chosen (by-the-way ... the record number and the record ID are the same ... maybe it is showing the ID??) Either way, why won't the table show the correct user choice from the form?
I need to add new records to a table depending on what the cbo box displays. I figure this is the way to do it but I it's not working, I have only writen the first select,
Private Sub Comando6_Click() Dim dbPalavraChave As DAO.Database Dim rstchaveCFEPC As DAO.Recordset Set dbPalavraChave = CurrentDb Set rstchaveCFEPC = dbPalavraChave.OpenRecordset("chaveCFEPC")
This is what I'm trying to acheive and I'm sure its possible but cant quite get my head around it to do it.
I have a form with a multi select list box from which our customers can select a number of items they would like added to their worklist for the day. They then click on a command button which then sends those items to a table from which our employees then generates a worklist.
However what I would like is that once the customer has entered their selections I would like them to be able to click another command button before submitting the work to the table which would then show them the selections they have made before the info is submitted to the table. They would then review what they've selected and make additions or subtractions as neccessary.
I'm not sure whether or not I have to create two tables the first of which would hold their initial selections and then the first button would then run a query based on that first table and then once they click the submit button it sends that info to another table from which the days worklist can be drawn.
Another question is what if once they've reviewed what they've selected and wish to remove something? If selections go to a temporary table and then they unslected an item will that remove it from the table or would it create a new record which is not what I want.
If you could help that would be most aprreciated. I know very little in the way of coding so any explicit instructions would be most welcomed
I have a Listbox [ListRandom], that populates a random selection of employees. The listbox is set to "Multiple Select = Simple" What I have now is: I can select several employees and then click a [print] button, this prints an individual form with those employees information, and then adds them to a table [tblselected]. What I am trying to accomplish is After those employees are selected, printed, and added, I then want to go back to the random list to select the other employees, but I would like the first ones that were selected/highlighted to refresh and be gone, so that I dont accidently add the same employee twice.
Is this possible? And can someone point me in the right direction. thanks....Enviva
In my application, I am allowing multiple selection in a listbox. The data is saved in table. While retrieving, the items that were selected for saving, show as selected. But on printing ListIndex, it prints -1. What could be wrong ? I need to resolve it. Any solution ?
Hi, below is the codes that I use to produce a report based on user entry on a form. On the form is a listbox for the user to select the report they wish to view. On the same form, the user must enter the date. Depending on certain selections, some fields on the form are not required. How can I force the fields that are not required to become disable based on the selection from the listbox. Thanks
Private Sub cmdGetReport_Click() Dim strRptName As String strRptName = Me.lstReports.Value
Select Case strRptName
Case "Originations by Branch"
DoCmd.OpenReport "rptOrigByBranch", acViewPreview, , "ClosingDate Between #" & Me.txtStartDate.Value & "# AND #" & Me.txtEndDate.Value & "#"
Case "Loans Sent to Branch"
DoCmd.OpenReport "rptLoanSentBr", acViewPreview, , "Br = '" & Me.txtBranchNo.Value & "' AND ClosingDate Between #" & Me.txtStartDate.Value & "# AND #" & Me.txtEndDate.Value & "#"
I'm having trouble with with my form (frmViewCust). What I am attempting to do is create a form which shows a list of customers (from a query) and has a section with the customers details (from tblCustomers). I need it so when a certain customer from the list is selected, their details will be shown in the customer details section.
The best i could do was have the list and details as sub forms (fsubListCust an frmCustDetails). I made frmViewCust to show records from the same query as fsubListCust and create the textbox CustomerID. I successfully made it for when the CustomerID is shown, fsubCustDetails shows correctly corrisponding with the same CustomerID made. How can i make it so when a record is selected from fsubListCust, the subform will change to the same record for frmViewCust.
Alternativly I made it so the list was a list box instead of the sub form, however I still encouter the same problems. I can't make it so the record (shown in the navigational button) is changed to be the same as the record selected in the listbox.
I am designing a small database. I have problem in selecting Mutiple list values from list box.
I have a table of Personal.With fields SrNo ------------- autonumber Name -------------- Text Age ---------- Number Interset ------------ (Text) //In Interset Properties through lookup tag I have Display Control -------ListBox Row Source Type --------- Value List Row Source ---------------- "Swimming","Football","Cricket",hockey"
When I made form I got all the List Box Items. For single Selection it has worked. But If I want Multiple selection. I changed the property List Box property Multi Select from "None" to Simple. Now It worked with Multiple Selection.But If one first record I select Swimming, Football.On second record it would be blank. And select my self. But the previous one is saved on all the next records.If two selction on first next all same selction with 2. If three then three.
I want Individual selection. It must be saved.According to corresponding record.
I have been working on this problem for 3 days, and can't figure out what to do. I'm using Access 2010.
I have two tables. Tier1 and Tier2.
Table: Tier1 has Tier1ID (autonumber) and Tier1Desc
Table: Tier2 has -Tier2id (autonumber) -Tier1ID (which is the link back to the Tier1 table), -Tier2Num -- this number shows which tier2 records are associated with each other - and about 6 fields with descriptive info, 2 of which are memo fields
I have a form that has 2 listboxes:
- Listbox 1 has the row source to Tier1 table, control source Tier1ID - Listbox 2 is an unbound listbox with the row source to a query.
The query is all the fields from Tier2 with the criteria where Tier1ID in Tier2 table = Tier1ID in Tier1 table
This all works. When I select something from the Tier1 ListBox, it displays the associated tier2 items for the tier1 selection.
What I need : When the selection is made in the 2nd listbox, I need the other 6 fields in tier2 table to be displayed based on the "Tier2Num". The listbox does return Tier2Num correctly.
I just need to display all the rest of the fields.
- I tried a popup form based on a query, but can't seem to pass the tier2Num to a form. (The query works if you enter the Tier2Num, which is the [listitem] selection) - I tried dlookup in a textbox - I tried to add all the fields into the listbox, but could only get 3 to display (then I was going to do textboxes with the control(#) in it.
Hi all, greate site and i have been able to solve most problems by using the search box although this problem is doing my head in...!!
I have a db that records project numbers and their details. I am using a listbox to allow a user to multiselect Project Involvements Tasks(ie Documentation, Build etc) against a project number.
I am able to read the selections into a separtate table with two columns which is structured as:
as you can see I dont have a problem getting the Itemsselected into a table... the problem that i am having is getting them out again when the record is displayed - ie marking them as itemsselected.
I believe that the event would be onCurrent which would loop through this table pick up the project number and recorded invovements and mark them as selected in the listbox. if there is no invovement then the listbox would show no selections.
I am using this code to read the selections in
=========================== 'Records project involvements against project Public Function AddInvolvements(ctlRef As ListBox) As String On Error GoTo Err_AddInvolvements_Click
Dim i As Variant Dim dbs As DAO.Database Dim rs As DAO.Recordset Dim qd As DAO.QueryDef Dim strDelete As String
Set dbs = CurrentDb Set qd = dbs.QueryDefs!qInvolvement Set rs = qd.OpenRecordset
'Delete records where project number exists against an invovelment incase of involvement changes strDelete = "Delete Project_Involvement.ProjectNo " & _ "FROM Project_Involvement " & _ "WHERE (((Project_Involvement.ProjectNo)=[Forms]![Add_Project_Details]![ProjectNo]));"
For Each i In ctlRef.ItemsSelected rs.AddNew rs!InvolvementType = ctlRef.ItemData(i) rs!ProjectNo = Me.ProjectNo.Value rs.Update Next i Set rs = Nothing Set qd = Nothing
Exit_AddInvolvements_Click: Exit Function
Err_AddInvolvements_Click: Select Case Err.Number Case 3022 'ignore duplicate keys Resume Next Case Else MsgBox Err.Number & "-" & Err.Description Resume Exit_AddInvolvements_Click End Select
End Function ===================================
Any help would be much appreciated - also thanks to Pat Hartman for his excellent examples esp http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=54924
I need to create a form to Add/Update into SMaster and SI_map tables, which has one-to-many relationship, that's why I use a list box to show the values from SI_map.
in SMaster [ Sid, other fields ] in SI_map [ primary key, Sid, ILookupid ] in ILookup [ ILookupid, IName ]
questions: 1. How to get the multi-selected values from the list box? 2. insert these multiple records into SI_map table at the same time with SMaster (if I use the same form to populate all these fields) 3. how to populate the records into form for user to see and update the values?
Any suggestion is appreciated, it is very flexible to change any format such as SMaster and SI_map can be separate forms, as long as it works.
I have a form which has a listbox listing all the letters a student has had sent home. Basically i want to be able to click on a letter in the list box and for a popup form to open with the record details. However it just brings up a blank record.
The list box has a unique field called standardletterID.
the code behind the button to filter was just used through the wizard to open the popup form is:
Dim stDocName As String Dim stLinkCriteria As String
Need help on a list box issue. Solution is probably real simple, just can't see it with my bleary eyes.
I have a form (INSTLKP) with only a list box (List6) based on a table ((tblPersData) with fields PersdataID; SSN; Last; First; MI) on it. When I open the form up, the listbox does display all records associated withthe table. I would like to doubleclick on a desired SSN in the list box and have that record open up in a form (Perssub1) in edit mode.
And that is where the rub is... I have the following code in the On doubleclick event of List6
I am currently working on a form for my users to look at budget data. I have several listboxes for them to filter queries by. What I was wondering is, if it is possible to have data in one list box be filtered by the preceeding listbox?
For example: Three list boxes: Report_Period, Budget, Dept.
Each list contains all the values possible. This data is all in a filter table (and the listboxes created using SELECT DISTINCT queries to that table for the specific field). So, if I select Budget XYZ, could I filter the Dept listbox to only show the dept.'s associated with that budget? These are all multi-select listboxes by the way, so budget ABC and XYZ would only show the departments associated as well.
I have a form called "Record Call" when a user can input the calls that they have made or are scheduled. This form is based on the table "Call Records". I have created a new table called "CallAttendees" and added a listbox to my form for users to select who attended/participated in the call.
My code loops through the selections and writes these selections to the "CallAttendees" table. In this table i have an auto #, CallRecord, and Attendee fields. My code is supposed to write the "ID" field from the "Call Record" table to the "CallAttendees" table so that i can create the relationship between the two tables. However, this field is coming up blank since my form isn't generating the auto # until the record is closed.The tables are stored in a SQL server. I also tried saving the record prior to running my code.
I have a list box that is correctly listing resources from a table (tblResource). I would like to select one of the list box entry and run a query against the tblResource to show the information for that resource in a form. I have tried to use the lstindex with the control (lstResource) in the where clause of a query to accomplish this with no success.