How To Populate List Box With Self-customed Data
Jul 12, 2007
I have a listbox call lst with two columns, what I want to do is to populate this two column with "firstdata" and "seconddata" respectively.
What I do is:
Me.lst.RowSource = """firstdata""; ""seconddata"""
But I see nothing appear, what is the corect way to achieve in vba?
View Replies
ADVERTISEMENT
Mar 6, 2008
Microsoft Access 2003
Novice and working on a project with deadline... please help.
I have a table w a field that I want to convert into a combo bo and use data in the field as the options:
FIELD: Student Status
OPTIONS:
Enrolled
Suspended
Withdrawn
How do I get the combo box to automatically pull the values from that field into the options in the field when u pull down the drop down box?
Am I being clear?
View 2 Replies
View Related
Feb 27, 2008
I have 2 questions/problems:
1. I want to populate a list box with all the Tables Names in my Database using VBA.
2. I also want to create another List Box or Grid (or any thing that will show table data) that when i have select a Table Name (See above (1)) it will show all the data in that table in the List Box. Was thinking some kind of SQL using vba to populate the list box?
Any ideas or help will be much appreciated
Richard
View 1 Replies
View Related
Nov 23, 2012
How to populate a list box using another list box on the same form. I have this working completely fine if the the source list box has the multi select property configured to be off, however I need it to be set to extended multi select.
View 1 Replies
View Related
Mar 25, 2007
Is it possible to populate several fields on a form via a Nma e selected from a list box ie: the list box has several names in it, the names have data from another form (user details) such has Payrole No:, Holiday entitlement, etc.
I want to select a name from the List Box and have it populate (enter) data into field in the form being used.?
View 5 Replies
View Related
May 29, 2006
Hi there,
I am finally underway with the forms etc, after having spent weeks planning and setting-up the table/relationships.
I have entered some sample data so that I can test out the forms as I go.
I have an "Unbound" list box and an "Unbound" combo box, (along with other stuff) on a form.
The list box gets it's data from a Junction Table between "Customers" and "Products".
I can get the list box to populate itself with ALL the product items in the junction table but I have tried and tried to filter the items down to match the selected value in the combo box.
A couple of diagrams (jpegs) can be viewed here
If anyone could spare the time to enlighten me on this "blind-spot" I would appreciate it very much.
Thanx
View 3 Replies
View Related
Jun 29, 2005
In my list box I have two coloums, Surname and Christian Name, now can I get both names to go into a text field. I can get one of the names i.e surname or christian name by changing the bound coloum from 1 to 2. But I need both names to go across?
View 2 Replies
View Related
Oct 28, 2013
So Im trying to populate the listbox using string connection and having this error: "the object you entered is not a valid recordset property"
here's the code:
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = New ADODB.Connection
cnn = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=xxx;DATABASE=xxx;Port=xxx;USER=xxx; PASSWORD=xx;OPTION=3;"
[code]....
Where is the error??? am doing right or is there any better way to populate listbox from string connection.
View 8 Replies
View Related
Nov 9, 2006
Hi all,
I need some help with regards to a small db application im developing.
I currently have a form that contains two separate list boxes.
The first contains "Measures" and the second "Dimensions". They are based on the underlying tables Measures and Dimensions respectively.
My intention is to be able to select whatever Measures I want and select the dimensions they relate to in the other list box then click on a command button to run a query that would update/append my underlying table, Measures2Dimensions, which is linked to the tables that the list boxes are based on.
I hope I've described my problem well enough for someone to provide me with some help.
Many thanks in advance!
View 4 Replies
View Related
Jul 8, 2007
I wish to automatically fill in a form in datasheet view with records from a table. Currently you need to select each record to fill the list. I think this can be done using VBA, I'm a begininner to programming but think I need the code to do something like this.
Lookup the table or query, DoCmd select the first record, DoCmd select next record, Loop to end of recordset??
Basically it is automatically entering/ filling in each row (record) in the datasheet for every record in that table or query.
Any idea's please.
View 2 Replies
View Related
Nov 28, 2005
I have three list boxes on a form (lstSubjectName, lstTargetGrName, lstCountryName). The list boxes are populated from queries
based upon tables that have a many-to-one relationship to the main table. The
queries are the following:
SELECT tblProjectSubject.ProjectID, tblProjectSubject.SubjectName
FROM tblProjectSubject
WHERE (((tblProjectSubject.ProjectID)=[Forms]![frmViewPro]![ProjectID]))
ORDER BY tblProjectSubject.SubjectName;
SELECT tblProjectTargetGr.ProjectID, tblProjectTargetGr.TargetgrName
FROM tblProjectTargetGr
WHERE (((tblProjectTargetGr.ProjectID)=[Forms]![frmViewPro]![ProjectID]))
ORDER BY tblProjectTargetGr.TargetgrName;
SELECT tblProjectCountry.ProjectID, tblProjectCountry.CountryName
FROM tblProjectCountry
WHERE (((tblProjectCountry.ProjectID)=[Forms]![frmViewPro]![ProjectID]))
ORDER BY tblProjectCountry.CountryName;
The form is based on the main table (tblProjects).
I want to re-populate/update the list boxes when the ProjectID on the form
changes. I have tried to use a macro (ProjectID_AfterUpdate) for requery of
the list boxes, but can't get it to work.
Any other solutions? Thanks.
Niels
View 5 Replies
View Related
Jul 10, 2014
I am trying to populate a ListBox with the names of the tables from another database. I have the following function which loops the table names from the database I want. The function is caleld on Form Load and passed into the ListBox but the List Box is empty.The message box in the function does display the table names when called from the form. I just cannot get the list box to populate.
Code:
Public Function ListTables()
Dim db As Database
Dim i As Integer
Dim s As String
Dim tdefs As TableDefs, tdef As TableDef
Set db = DBEngine.OpenDatabase("C:MyPathAnalyzed Tables.mdb")
[code]...
View 5 Replies
View Related
Oct 25, 2013
Is there a function that will populate a field with drop down menu based on two criteria?I want the the fields with first and last name to populate with drop down lists based on the employee code I have inputted in the form and job title from a query.
Path: looks at employee code from form > looks at specific job title from query > pulls out all first names in one field and all last names in another field with the same job title in drop down list from query
Employee Code: 100
Returns all employees' first names in first field with same job title:
Prince
Tina
Greg
Returns all employees' last names in second field of form with same job title:
Fey
William
Jones
Here's what the query looks like in datasheet view:
Code:
Location # First Name Last Name Job Title Employee Code
1 John Smith Technician 100
2 Jane Doe Manager 100
2 Greg Jones Engineer 100
1 Prince William Engineer 100
1 Tina Fey Engineer 100
I've been trying to get dlookup to work, but no luck. Here's one of my formula:
Code:
=DLookUp("[Last Name]", "[Employees tb]", _ "[Employee Code] = Form![Employee Code]" & "[Employees tb]", _ " [Manager]"
SELECT EmployeeCodeONLY.[Employee Code] FROM EmployeeCodeOnly;
SELECT [Employees tb].[First Name] FROM [Employees tb] WHERE ((([Employees tb].[First NAME])=[Forms]![Form1]![Employee Code]));
The first is linked to a separate table that only contains employee codes because query I am working with has duplicates due to multiple records.The second is trying to link both the table and query together to populate only first name.how to include the second criteria, job title, to refine it more.
View 1 Replies
View Related
Mar 15, 2006
You veterans have probably heard these questions many times, I've had a search around but couldn't find quite what i was after.
This is my first database.
I have 2 tables, one for customer details, and the other is products (holiday packages)
I have made a product form for staff to input new holiday packages. And for the customer form this is also the order form, so a staff member picks up the phone and gets customer details, name, ph, etc and then asks what holiday package they want. I want this to be a drop down list that always fetches all the packages availiable form the product table and when you choose a package it shows all the details on that package.
I need this all to be on the 1 form, if the staff member has to swap back and forth between customer form and product form to get info on a product this will severly hamper productivity.
If my question is abit hard to understand i can take screen shots of my tables/forms to get a better idea. And if someone can really help me finish this database off i'll pay them somethign for there trouble.
Regards, Chris.
View 8 Replies
View Related
Jun 19, 2015
I have a form set up (in a list box) to show our salespeople what parts they have yet to get out of inventory but have a sales order for. The list box shows a list of all the salespeoples names. My manager wants me to show ONLY the salespeople that have populated fields in this list box. The list box currently shows all the salespeople, but I want to see only the ones that have inventory that has yet to shipped. How do I go about this?
View 4 Replies
View Related
Feb 10, 2014
I have 2 tables.
tblOrderType
1 - Maintenance Order
2 - Breakdown Order
3 - Greasing Order
On my form I have two list boxes: An Order Type List box, and an Area Listbox.What query criteria or VBA code would I use so that I could populate a text box with the relevant order number based on the selections of the list boxes. i.e. MaintenanceOrder & Area Z would display MaintenanceOrderNoZ.
View 2 Replies
View Related
Oct 10, 2013
I have a form called Adaptation Form in which Last Name and Course Number are entered.
The user looks up Last Name using a listbox on the form, and looks up Course Number using a second listbox on the form.
To use the form, the user looks up Last Name in the listbox, finds the ID number associated with the Last Name, and enters the ID number on the form. The form then autopopulates with the last name. The process for entering a Course Number is the same.
This populates the query underlying the form, but not the table. All that gets populated in the table is the ID Number for Last Name and the ID number for Course Number.
View 3 Replies
View Related
Nov 27, 2012
I have a table of data which includes a date field and also various other fields which may or may not be filled with data.I'm trying to populate a listbox with the months for which this data is missing (a separate macro will then loop through these months to fill the missing data) But I only want each distinct month to populate the listbox - not each individual date.
Code:
strSQL = "SELECT DISTINCT month([EntryDate]), year([EntryDate]) FROM [SampleTable] WHERE [ValueField] Is Null"
Me.lstSampleListBox.RowSource = strSQL
I want to return the month in <mmm yyyy> format.
View 2 Replies
View Related
Sep 9, 2013
I am trying to populate a list box with an event after update in a combo box. I can get the formula to work using 2 criteria, the problem is i nee to add a third criteria. When I try to add it I get the run-time 13 error.
Here is the code I am trying to use:
Private Sub cboStatusRFQ_AfterUpdate()
Me.cboSupplier.RowSource = "SELECT DISTINCT [Consolidated_Master_Req_Pool.RFQ Contact] " & _
"FROM Consolidated_Master_Req_Pool " & _
"WHERE consolidated_master_req_pool.Complete = FALSE AND [Consolidated_Master_Req_Pool.RFQ Supplier] = '" & Nz(cboStatusRFQ.Value) & "'" And "[cosolidated_master_req_pool.Status] = '" & "[SUPPLIER_RFQ FOLLOW-UP]" & "'" & _
"ORDER BY [Consolidated_Master_Req_Pool.RFQ Contact];"
Me.cboSupplier = Null
End Sub
View 2 Replies
View Related
Sep 16, 2013
I would like to select a record from my combobox dropdown list and have that record populate in my subform. Currently, I am only able to select the 1st record at the top of the dropdown list to appear in my subform. But I would like to select any record from the dropdown list and have it populate my subform.
View 8 Replies
View Related
Dec 11, 2005
I have 3 inputs based on which i'll fetch records from table in a subform for the given input criteria. Please let me know how to populate subform programmatically?
I tried source object property and form.recordsource property. It gives me some error or the other. let me know the right syntax to do the above mentioned.
Thanks in advance,
jwala :)
View 1 Replies
View Related
Jun 12, 2006
I have a standard Data Entry Form based on a WorkOrder. I am dealing with over 90 offices nation wide with mulitple offices in a state. I have a seperateTable that lists all 90 Offices which I have created a Query to Promt the user to enter the State code for that State.
Is there a way I can Select an Address from the Query and auto populate that information onto my WorkOrder form?
Any help would be greatly Appreciated as I have Exhausted myself trying to figure this out!
View 1 Replies
View Related
Jan 17, 2006
Ive been pondering on this problem for far to long now so decided it was time to ask here !
I would like to return (based on a query) some records that would populate a report. I can set the source of the report as the query but my issue is that I need to actually have some code prior to report population.
EG if they have two products I want to list them product1/ product2 and as far as I know this isnt possible when you just set the source for the report...
The data is coming from SQL server so I have the option of a stored procedure but from trsting that seems to make things even more confusing.
Any help appreciated as Ive been stuck on this for far too long !!
Phil
View 2 Replies
View Related
Jan 23, 2006
I have a form with two fields, EMPLNO and SURNAME.
By entering the employee number in EMPLNO or by entering the name in SURNAME I wish to get the correct record onto the form.
This is probably covered in the archive, but I'm not sure what to look for.
Any suggestions.
View 1 Replies
View Related
Sep 13, 2006
Hi
I cant get my head around this one,
I have a Form that enters all details for an Order.
On that form is a Tick Box that says Repeatable.
If that box is ticked in the future I am able to repeat on that stock item.
I have created a form with a List boxea that Lists all Suppliers Stock that is Repeatable
I want to be able to double click a Stock Item from that list, then let it populate another Order ( Unique Key ), fill in all the field from the previous order, so all I have to do is enter the Quantity I want to re-order.
How do I do this?
please help
Hightower
View 4 Replies
View Related
May 14, 2013
I have had to place it in a zipped word document that is attached.
View 6 Replies
View Related