Populate Field From A List Box

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 Replies


ADVERTISEMENT

Populate List Boxes When A Form Field Changes Value

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

Forms :: Populate Field With Drop Down List

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

General :: Populate List Box With Distinct Months From Date Field

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

How To Populate List Box With Another List Box Using Extended Multiselect

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

Populate With A List Box

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

How Do I Populate A List Box From...........

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

Populate List Box From Recordset

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

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 1 Replies View Related

Using List Boxes To Populate Tables

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

VBA Access - Automatically Populate List

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

Modules & VBA :: Populate List Box With Table Names

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

2 Forms On 1 Page. (and Having A List Box Populate A Bunch Of Fields)

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

General :: Pulling Certain Names From A Query To Populate A List Box?

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

Queries :: Populate Text Box Based On 2 List Box Selections

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

Form With List Boxes Won't Populate Underlying Table

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

Combo Box - Populate List Options Based On Data Already Entered

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

General :: Populate List Box With Event After Update In Combo Box - Run Time Error 13

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

Queries :: Using Variable In A List Field Query - Getting Complete List On Initial View

Mar 28, 2014

In my access form I provide the user a list of locations from various countries in a listbox . But the list is too long so I provide him a combobox for selecting a country. Selecting the country should update the listbox showing only the locations in that specific country.

So my SELECT from the listbox must cover the unselected state and show all entries and when a country is selected it must narrow the selection.

I tried to get this happen with the following SELECT statement containing a variable. Choosing a country in the Combobox results in a change of the variable and in a requery. This works after the first country is selected and for each country change, but the initial list is empty.

VBA in the loadform
'Application.TempVars.Add "varcountryselect", "*"
SELECT in the listbox "lstlocationsperproject"
SELECT tbllocations.locationID, tbllocations.country, tbllocations.localstreet, tbllocations.localcity FROM tbllocations WHERE ((tbllocations.country) Like [TempVar]![varcountryselect]);

VBA in the combobox
Application.TempVars("varcountryselect") = [Form]![kombcountryselect].Column(0)
Me.lstlocationsperproject.Requery

The values in [kombcountryselect].Column(0) are texts like "SPAIN", "MEXICO", etc.

Any hints, how I have to use the * for getting the complete list on the initial view ?

View 5 Replies View Related

Tables :: Auto Populate Field Based On Answer Of Another Field In Same Table

Feb 28, 2013

Within my table if Field 1 has an answer of Self (from drop down), then, I would like Fields 6-12 to auto populate; however, if Field 1 does not have an answer of Self, then leave Fields 6-12 blank.

I am not quite sure how to lay this out. I am using Access 2010.

View 8 Replies View Related

Make Field Auto Populate Based On Value Of Field In Another Table

Mar 4, 2008

I'm creating a database that keeps a track of questions and scores.

The questions in the database need to be dynamic and are changed frequently.

I have a scorecard table which keeps a record of scores and the applicable question at the time the record was saved. I need to do this because in 6 months time we may want to provide feedback. As the question may have changed we need to be able to refer back to what the question was.

I want the question field in my scorecard table to populate with the value in my question table.

I have tried a number of things including setting the question field in the scorecard table to a lookup based on the following query:

SELECT tblQ1.Q1
FROM tblQ1;

This works however only as a list or combo box. I don't want the user to have to select the question. I want it to auto populate, is this possible?

View 1 Replies View Related

Automatically Populate A Date Field Based On Value Entered In Another Field

Nov 10, 2005

I need to create a New Form control for this situation:

If I enter a date into a field and the choice for another field is equal to a certain value. How can I get the date I entered to be automatically populated into another date field.

For example:

If I enter 11/10/2005 in a date field and I choose either "BN", "BA", or "BT" in a text field, I need that date of 11/10/2005 to be automatically populated in another date field on the same form.

Any help is greatly appreciated.

View 2 Replies View Related

General :: Populate Field By Entering Date In Another Field?

Oct 24, 2013

I am wanting to populate a field by entering a date in another field. I am trying to determine age(years, months, and weeks) of something by entering a date in another field. Is that possible in Access?

View 1 Replies View Related

Auto Populate Linked Field With Key Field

Mar 22, 2005

I have a form with a main form and two subforms. The first subform automatically populates it's linked field with the data in the key field of the main form, but the second subform does not auto populate it's linked field with the data from the key field of the first subform. I have created main forms and subforms before and this was not a problem.
Is there a way to cause the second subform to automatically populate it's linked field with data from the key field of the first subform?

View 5 Replies View Related

Tables :: How To Auto Populate Field 2 From Key Field

Oct 17, 2012

I need a continuity field...transaction number..that can be both a parent and child key. Would like to create this upon accessing a new record / row.

View 3 Replies View Related

Forms :: Populate One Field From Another Form Field?

Jan 20, 2015

How do I populate fieldA in formB with FieldB from FormA..

So Field is the last numeric field in Form A..so I need to the take the calculation value of that field and be the starting value in formB.

View 14 Replies View Related







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