Getting Information Out Of A ListBox
Jun 14, 2005
I am brand new to Access(I started yesterday). I have a ListBox that gets its selections from a Query. I set it for MultiSelect, and now I have to figure out how to store the selections. The list is organized in accending order, which does not match the table that the Query is based on. I have no experience with VBA. The form name is Trouble_Ticket and the ListBox name is List24.
Thank you
View Replies
ADVERTISEMENT
Nov 22, 2013
From a search form example I got from this forum I made the following:
A listBox which shows results as you type, using a query.
This listBox has 1 column, I need it that way.
What I need is to show the information from the selected item of the listBox on a textBox, getting this info from the results of the query.
I found 2 answers which I don't like:
1- =DLookUp("[Column]","[Query]") as source of textBox
This shows only information from the first row. So if you select the second result from the listBox, it still shows the first row.
2- =SearchResults.column(int) as source of textbox
It does not work, because listBox has only 1 column.
View 4 Replies
View Related
Apr 21, 2006
Hi, I'm new here, so I hope I'm posting this in the correct place. I've searched the forum to see if there are any existing threads that might help me, but I've not found anything that does...
(I think this thread ( http://www.access-programmers.co.uk/forums/showthread.php?t=93444&highlight=Copying+data )may be trying to achieve something similar to me, but I'm a beginner and don't really understand it)
I shall stop waffling! I'm not entirely sure that what I'm trying to achieve is possible, I expect it probably is!
Right, I have a form (frmGroupRegister, which contains exactly the same fields as the table it comes from, tblGroupRegister), which consists of three things:
-GroupDate - The date a group took place on. It is my primary key, as no more than one group occurs on a specific date.
-ParentList (A listbox which contains a query showing the ID number, forename and surname of everyone in a table, tblParentDetails)
-ParentsAttending (A blank listbox)
I would like to place buttons in between the ParentList and ParentsAttending, which would allow users to conduct a 'register' of attendance by copying individual/multiple details from ParentList into ParentsAttending (much like you get when choosing which fields to include in a form when using a wizard for example). I would also like them to be able to remove people from ParentsAttending by using a button in case of accidentally adding the wrong person into the ParentsAttending box.
I'm aware that another, probably simpler way of achieving this would be to use a tick-box system, but I feel that visually, the first method would both look better and demonstrate who is present more clearly.
Any help would be much appreciated, but my Access skills are quite basic and things will probably need to be spelled out for me.
I'm using Access 2000 and Windows XP.
Thanks for your help,
Alice :)
View 1 Replies
View Related
Jun 10, 2015
I am using the selections made of the form to generate a query for the user.
I have a CITIES listbox that is populated with values from a stored query.
I would like to make it multi-select and populate a LOCATIONS list box and a NAMES list box based upon the CITIES that are selected.
I have the locations currently populated from a stored query that reads the City selection from the Form. It looks like this
Code:
SELECT DISTINCT (t_location.LOCATION) AS Expr1
FROM t_location INNER JOIN t_asset_master ON t_location.LOCATION_PHY_ID = t_asset_master.LOCATION
WHERE (((t_location.CITY)=[Forms]![MasterQueryGenerator]![CityList]));
I also want multi-select so that is you can un-select all and get the results for all cities.
Here is my half thought approach.
Code:
Private Sub CityList_AfterUpdate()
'Dim LocQryStr As String
'Dim r As Integer
'Dim ctl9 As Control
'LocQryStr = "SELECT DISTINCT (t_location.LOCATION) " & _
[Code] ...
I intended to have the variable LocQryStr as the row source but I abandoned the idea of having multi-select when I saw that .Selected(I) never returned true. Its like the values aren't read in this subroutine.
View 5 Replies
View Related
Sep 9, 2013
I have a list box called "product list box" based on a query called "searchqry", i also have another listbox called "type list box" , how do i get the type list box to only show "types" based on the section in products list box?
View 1 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
Oct 23, 2013
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?
View 7 Replies
View Related
Jun 17, 2005
Hello,
I've got this multiple select listbox which writes data into a textbox:
Private Sub List2_AfterUpdate()
Dim Cursisten As String
Dim ctl As Control
Dim Itm As Variant
Set ctl = Me.List2
For Each Itm In ctl.ItemsSelected
If Len(Cursisten) = 0 Then
Cursisten = ctl.ItemData(Itm)
Else
Cursisten = Cursisten & "," & ctl.ItemData(Itm)
End If
Next Itm
Me.txtCursisten = Cursisten
End Sub
And I've got a SELECT ALL button to select all records in the listbox:
Private Sub cmdSelectAll_Click()
On Error GoTo Err_cmdSelectAll_Click
Dim i As Integer
If cmdSelectAll.Caption = "Alles Selecteren" Then
For i = 0 To Me.List2.ListCount
Me.List2.Selected(i) = True
Next i
cmdSelectAll.Caption = "Alles De-Selecteren"
Else
For i = 0 To Me.List2.ListCount
Me.List2.Selected(i) = False
Next i
cmdSelectAll.Caption = "Alles Selecteren"
End If
Exit_cmdSelectAll_Click:
Exit Sub
Err_cmdSelectAll_Click:
MsgBox Err.Description
Resume Exit_cmdSelectAll_Click
End Sub
The only thing is that when I use the SELECT ALL button, the function List2_Afterupdate doesn't work anymore. There must be a simple solution but I just can't figure it out. Can anyone please help me?
Tnx a lot!
View 13 Replies
View Related
Jul 16, 2006
Hello everybody,
Hopefully somebody can help me on this one. I searched the whole internet and access forums, but I didn't find the exact solution for my problem.
I've got a table with students, a table attendance, where I now only save the students who are absent, but I would like to save also the students who are PRESENT (at the same time).
I've got a combobox where I filter the Class, which then updates a listbox with the students from that class. What I do now is select the students from the listbox and then press a save button and it saves the records to the table absence with STATUS: ABSENT.
I would like to save the NON selected students also in that table, but with PRESENT in the column STATUS.
I thought of making another listbox next to it, where after selecting the absent students, they wil apear and disappear in the PRESENT table so I can store all the information.
But the only problem is that I can find this solution when the listbox is populated by a list of values instead by a table or query. And the other solution is to store the temporary data into 2 different tables, but that's not working for me because it's a multi user database and everything will be messed up.
Hope that someone can help me, I will be very happy.
View 4 Replies
View Related
Jan 20, 2014
Firstly, is it possible to hide unchecked values in a listbox? I have a user with several roles and I want to only show the ticked roles in the listbox.
Secondly, can you create a hyperlink on listbox values? i.e, if I click on "Manager" in the roles listbox, it follows that to another form and opens the record about managers?
View 10 Replies
View Related
Jan 4, 2006
I wonder if anyone has a quick fix for me. I have two tables in a project management DB that I am making. The first table is a projects table and the second is a tasks table. I would like to have a list box in the projects table containing all the tasks completed for the specific project. However, the current list box is showing all tasks rather than the ones specific to the project ID. The project ID is the primary key in the projects table and the foreign key in the tasks table. I am not sure if/how setting up a filter would correct this or if I just need to adjust the relationships. An example of the DB is avaiable if helpful.
Any advice or ideas would be greatly appreciated.
View 1 Replies
View Related
Jul 12, 2006
I have a client who wants his Accs db converted to MySQL. I have no problem understanding MySQL. However, my knowledge is limited with Accs.
This db is quite large (53mb) and has several tables, queries, reports, forms, modules, etc. I suppose he tried to create a backup and sent it to me. The problem is that all I have are the tables...nothing else.
Did he do something wrong or is that standard w/ Accs? Is there anyway I could have all of the information saved to some type of txt or .doc file and send that to me? I understand that would make it larger. The problem is right now Im on his computer (networking) and it's running too slow. I'm having to make screenshots and what-not (and that's when his secretary ISN'T WORKING...so pretty much at night). Really need some suggestions with this.
Thanx,
Tim
View 2 Replies
View Related
Jul 4, 2006
I have got a set of information that has a mixed bag of names. Some have only a first name but some have a middle name also.
I am looking to shortern the information just to the firstname (i.e. in stead of the results showing "Bill William" as the firstname, i want to just show "Bill").
i tried using the Left function but because the strings are of varied length i need the cut off to be the space between the various names.
Any help would be much appreciated.
View 4 Replies
View Related
Dec 27, 2006
I seem to remember - way back in my access class that I have not used regularly, therefore have forgotten much - that there is a way to put a description of the query or form or table that pops up in a kind of box when the cursor is placed over the name. I hope that makes sense - if not, read on.
I have a lot of queries and would want anyone using them to know what they will do before they click on one - because it might mess things up.
Thanks in advance,
Peg
View 7 Replies
View Related
Feb 8, 2007
I am having a hard time linking some certain information. I think I have my relationships formatted correctly but not all the information is connecting.
For example: I have a form where I am creating a sales quote. In the form I have a combo box where I select my product ID. When I select the product ID, the product name automatically populates but the price does not.
I have attached a screenshot of my relationships. Can someone please look it over and see if anything stands out to you as being incorrectly formatted? Or offer any advise in getting my price to connect to the product ID I enter?
View 14 Replies
View Related
Mar 14, 2007
Hi there..
We have Access 2000 database. Everythign is working fine but suddenly it have started loosing information. I entered one record last week and its not showing up now.
I am not a remote user. I entered the data from local machine.
Do someone have any idea about this issue.
Thanks
Danny
View 5 Replies
View Related
May 25, 2007
I am implementing a quoting system at work. Many times, a customer wants the same job that he asked for last year or 2 years ago, so basically it's the same information. So when the customer calls, I look for his last quote, and then would add a button that would create a new quote (record) but with the same information. It would be a burden to enter all the same information each time the customer calls for the same job over and over again.
Thank you
View 4 Replies
View Related
Oct 10, 2007
Did you know that when you create an MS Access database, personal information such as your user name and the name of the person or company that the software is registered to is saved and displayed with the database file for others to see. Prying eyes simply goto 'File->Database Properties->Summary Tab' to see your personal information.
The fix is simple goto:'Tools->Options->General' and select the 'Remove PersonalInformation from file properties on save' check box. Next time you save, no more personal information.
Don't believe it? Look at some of the sample databases posted here - :eek:
:)
ken
View 1 Replies
View Related
Nov 26, 2007
Hi to everyone Could anyone please tell me if there is a developer for access so I can get them to finish my database.
A friend started a data base for me but he had a motorcycle acident and the worst happed I have tryed to finish it myself but I'm not very clued up.
I would like to get a quote to finish I have just gone self employed and need this to produce surveys for Asbestos.
Im sorry if i'm not aloud to post this here if not please remove.
I live in soton uk I can put the database up on my server for people to download.
Thanks again
Please can anyone help here
View 3 Replies
View Related
Apr 14, 2006
How Do You Do Dependant Fields?
Example being:
I have a list of Stores of which there are 4 Formats (Super, Extra, Metro, Express). Each of these formats have their own specific grades.
What i want to do is when entering a new store via a form, In the Format box i would choose one of the formats from a combo box then when i progress to the Grade Entry, i would only want to see the Grades for that particular Store Format.
Would i need to have different lookup tables for each of the format grades & how do i achieve the above?
Ive seen this done on Airline web sites, ie select outgoing airport then the destinations change to only those that can be reached by flights from the Outgoing airport.
View 3 Replies
View Related
Nov 13, 2007
Hi everyone,
I’m trying to understand building databases correctly; therefore, I am going back over Running Microsoft Access 2000 book.
I’m having some trouble understanding a section in the book on Building a Database, page 86.
“Data or information?
You need to know the difference between data and information before you proceed any further. This bit of knowledge makes it easier to determine what you need to store in your database.
The difference between data and information is that data is the set of static values you store in the tables of the database, while information is data that is retrieved and organized in a way that is meaningful to the person viewing it. You store data and you retrieve information. The distinction is important because of the way that you construct a database application. You first determine the tasks that are necessary (what information you need to be able to retrieve), and then you determine what must be stored in the database to support those tasks (what data you need in order to construct and supply the information).
Whenever you refer to or work with the structure of your database or the items stored in the tables, queries, macros, or code, you’re dealing with data. Likewise, whenever you refer to or work with query records, filters, forms, or reports, you’re dealing with information. The process of designing a database and its application becomes clearer once you understand this distinction....”
To me “data” is synonymous to information, facts, figures, numbers and so on. I guess this is why I am having a hard time understanding the above paragraphs.
Can anyone explain it in a way that a dummy can understand it?
Thanks!
View 14 Replies
View Related
Sep 9, 2005
I have set up 2 queries which are working correctly. The problem is when I try to combine them it brings back incorrect information. The 2 queries that work correctly are set up like this
Query1:
SELECT Projects.[Work Stream], Count(Poles.[New Pole No]) AS [CountOfNew Pole No], Sum(Projects.[Line Length]) AS [SumOfLine Length], Projects.Team
FROM Projects INNER JOIN Poles ON Projects.[Scheme No] = Poles.[Scheme No]
GROUP BY Projects.[Work Stream], Projects.Team
HAVING (((Projects.Team)=[EnterTeam]));
Query2:
SELECT Projects.[Work Stream], Sum([Material Cost]+[Labour Cost]) AS [Total Cost]
FROM Rates INNER JOIN (Projects INNER JOIN [Pole Work Instructions] ON Projects.[Scheme No] = [Pole Work Instructions].[Scheme No]) ON Rates.[Rate No] = [Pole Work Instructions].[Rate No]
GROUP BY Projects.[Work Stream];
Do you have any idea how I can combine these to get accurate results?
View 3 Replies
View Related
Aug 13, 2007
Hi all I have this SQL SELECT [TripDate]+[NDays]-1 AS [DutyPayment], Count(tblTrip.NDays) AS ConteggioDiNDays, Sum(tblTrip.FlyingTime) AS SommaDiFlyingTime, Sum(tblTrip.TAFB) AS SommaDiTAFB, tblTrip.DutyPayRate, Sum([TAFB]*[DutyPayRate]) AS [Duty Pay]
FROM tblTrip
GROUP BY [TripDate]+[NDays]-1, tblTrip.DutyPayRate;I need now to group the information by total x month of "DutyPayment" with the following format "yyyy mm"
Example 2007 05, 2007 06, 2007 07
Thanks
View 1 Replies
View Related
Feb 4, 2005
I am currently working on a project for our training dept to link staff members to particular peices of equipment. I have created two tables - tblEquipment and tblStaff_Table. I have also created a form based on a query that gets the staff details based on the surname. Within the staff form I have a subform that allows equipment to be linked to staff members. What I am trying to do is when a specific piece of equipment is selected, only those additional bits of data related to the piece of equipment, such as manufaturer or model no. are shown - sort of like an autofilter in Excel.
I have been banging my head against a brick wall with this one. I'm sure that Access can do this but I can't work out how.
Can anybody help?
David :(
View 2 Replies
View Related
Apr 14, 2005
i am trying to create a form with a sub-form in it. i have got my client details in it - address, phone, etc then within that table i would like to keep a track of treatments for each time they visit in decending order. can anyone help me out with this? hope someone understands what i mean
View 3 Replies
View Related
Jun 6, 2005
Hi,
First of all thanks to everyone who has answered my questions already, although I'm still having problems (more with my understanding and lack of Knowledge)
I'm creating a DB and I'm stuck, I'm trying to create a form that has three fields mailbox, applications & Drives. Each of these three fields need to be populated with many items. For example the mailbox field may have 5 different mailboxes required to be populated in this field.
What I want to happen is for the user to double click on the text box, then a new form containing a multi-select list box appears that you can select the items you need which in turn updates the role profile form. This is how I want it to work but if you have a better idea I'm all ears.
All I want is for someone to be able to view the role profile form and to be able to see what applications, drives and mailboxes are required for that role.
Basically I have no idea how you can get someone to choose several items and have that reflected and recorded in the required record.
I have attached what I have at the moment and any help or advice you can supply is appreciated.
View 2 Replies
View Related