How To Make A Table Lookup Field Depend On Value In Another Column

Sep 20, 2012

I have a table called Locations that lists Countries and Cities:

USA, Detroit
USA, Chicago
USA, New York
UK, London
UK, Liverpool
UK, Birmingham
France, Paris
France, Le Mans

I then have another table for inputing details on people I know. This table would have columns called Country and City. I've figured out how to make the Country column a "lookup column" so that I can only enter USA, UK or France. But how do I make the City column show only the appropriate list of cities relevant to the country that I've selected (e.g. Paris or Le Mans if France is the selected country).

View Replies


ADVERTISEMENT

Lookup Table - How To Make More Than 1 Field From Query Appear In The List

Dec 1, 2014

In Access, when using Look Up function, Table/Query, how do I make more than 1 field from the query appear in the drop down list?I will be doing the same thing for students and some other tables. But for this example I am only wanting to show instructors first and last name and their ID number in the drop down.

I am using

Code:
SELECT instructors.first, instructors.last, instructors.ID FROM instructors;
in my Classes table.

What am I doing wrong?

I would like for it to show their instructor first and last name but actually put the ID in the field as I will be using that key for various relationship based functions. Show the first and last name to the person who will be using the database, but actually put the ID in the field so I can use it as a common field across other tables.

View 1 Replies View Related

Forms :: Make One Combo List Depend On Another

Sep 24, 2014

I have a combo: cmb_TrainingType. The sql is:

Code:
SELECT tblTrainingType.TypeID, tblTrainingType.Type FROM tblTrainingType ORDER BY tblTrainingType.Type;

My second combo (the one that should be filtered based on the Type chosen above) is cmb_Project_Title. The sql I have written (which isn't working) is:

Code:
SELECT tblCourseDetails.CDID, tblCourseDetails.Project_Title FROM tblCourseDetails WHERE (((tblCourseDetails.TypeID)=Forms!frmResourcing.cmb_Training_Type) And ((tblCourseDetails.Type)=Forms!frmResourcing.cmb_Training_Type)) ORDER BY tblCourseDetails.[Project_Title];

Both of the tables that are referenced have the fields TypeID and Type.

View 1 Replies View Related

Column Names. Can I Make The Name Field "higher"? (to Make Room For More Lines)

Sep 25, 2006

I'm currently working with a form, which is in datasheet view. I have many rows which are combo boxes (yes/no), and the name is rather long. So each line (each row) spreads on to 2-3 pages to the right.What I would like to do is make the namebar, on top of every column, a little bit higher, so the name would be split into two lines, or three. Allowing me to make the width allot smaller.Here is an example of my problem:http://213.213.137.96/~terminal/columns.jpgSo my question is, can I change the height of the column name? Or is there some trick I can use?regardsFrímann Kjerúlf

View 1 Replies View Related

Table That Depends On One Another Lookup Column

Nov 6, 2014

I have a table machine with fields:
ID(PK)model ( lookup column to machine model)serialnotype

Then a table meter reading:
IDmachineserialno (lookup column to tblmachine/serialno)readingdatetotalcounter

I want it to be like when i press lookup column in tblmeterreading/ machine serialno....it shall show the machine serial no|model in the popup combobox.

Instead it shows my machine serialno|id,

for example: when I select the machineserialno. a combobox shall show:
s/n:221233 | sony

instead it show:
s/n:221233 | 1

??

View 4 Replies View Related

General :: Make A Msg Box In A Form Where Values Are Lookup From A Table?

Jan 11, 2014

i am working on a school database, in data base i have create two tables tblAccounts and tblTransaction and a form frmTransaction .

tblAccounts contain two fields
GLcodes
Description
and frmTransaction contain
Glcode
transaction type
debit
credit
date
narratives

in form when i enter a glcode, lookup field match the code from tblaccounts and shows the description in form against gl code.But i am facing a problem when i enter a wrong gl code my form accept it and move to the next field and when i leave blank field of glcode same problem that i am facing, i want that , when i enter a wrong glcode in a form amsgbox will apear that asking for correct glcode.

View 5 Replies View Related

General :: Lookup Field - Adding Another Column To Enter Data

Aug 2, 2013

I have got a a form storing all employee's information and on that form I have a lookup field which looks up all the records in the "Qualification table" and the user can select multple qualifications. What I want to add to the lookup field is a data box so you can select a qualification and then enter the date that it expires (different for expiry date for each employee) How do I do this?

I have added the date field to the qualification table but when I create the lookup field on the form it shows the qualifications and a blank column next to it which data can't be enteed into.

View 2 Replies View Related

Crosstab Queries, Column Headings And Lookup Table

Aug 22, 2006

Not sure if there is a quick answer but I am trying to complete a crosstab query that references a lookup table. I cannot remove the lookup tables because the database was designed by a consultant. The lookup table is referenced as the column heading. The query works fine until I change the column headings in the properties box - it returns the column headings but there are no values. Am I doing something simple wrong or is it having troubles because it is a lookup table for column headings.

View 3 Replies View Related

Modules & VBA :: Wildcard Search Of Combobox - Lookup Values In Table Column

Nov 19, 2014

I have a form which has a combobox called Task_Ref which looks up values in a table column.

I would like to be able to set the tickbox value of tickbox called P1 to True if the combobox contains the word "test", each entry on the combobox selection may vary such as:-

Test number 1
Yesterdays Test

As long as the word "Test" appears I would like the above to happen?

I was thinking of something along the lines of:-

If InStr(Task_Ref.Value, "Test") > 0 Then
P1.Value = True
Else
P1.Value = False
End If
End Sub

But this hasn't worked

View 4 Replies View Related

Tables :: Converting Excel Table For Lookup Of Values Based On Row And Column Headers

Sep 3, 2014

how data is best structured in Access.I have a table of values (for instance: weight) and I need to be able to look up a weight based on the column header (age) and row header (height).How is this sort of data best structured and accessed in Access?

View 12 Replies View Related

Make-Table Action Query Column Data

Jan 30, 2006

I use a Make-Table Action query to import data from a linked table into my database. The linked table is on a network server that is automatically updated.

One column of the linked table is named "QTY/PARTIAL" and approximately 10% of the 500 records have a "P" after a number i.e. 1000 P. I would like to separate the number and the P into separate columns in the new table to faciliate being able to compute the total number "QTY".

Thanks,
Gunner...:confused:

View 12 Replies View Related

Tables :: Replica Trying To Make A Column Addition To Table

Sep 11, 2014

I have a replica at work, 1 copy on the network, 1 local.. I need to add a column to the main table, getting "Operation is not supported for this type of object".... I have users that use the database but was given a change to the form/report which requires a column addition. What is the simplest way to get around this??? I'm trying not to get into major problems.

View 1 Replies View Related

Make Column Show True False In Table

Jun 19, 2014

Can make a column show true or false in a table when two other columns in the table match each other? I think the statement would be like this:

If([Column1] = [Column2], True, False)

The only problem I am having is that I don't know if it can work in a table or does it just have to be in a query?

View 8 Replies View Related

Dropdown List To Depend On Other Field

Mar 15, 2008

I'm trying to set up a database of books in a small library - each book has a prefix (Maths, English, Art etc) which I want users to be able to pick from a drop down list - I can do this, but the next field is a sub-category - is there a way of populating the dropdown list for the sub-category field depending on the chosen entry in the prefix field. eg if maths was chosen I would like the user to have the choice of number area, volume etc. but a different choice if the prefix was English.

any help very gratfully received - it seems to be a simple problem but it has me stumped.

View 14 Replies View Related

Forms :: List - Values From A Table Depend On Selection From Different Table

Jul 23, 2015

Situation: 3 tables. Manufacturers, Countries & Provinces/States. 1 Form for data entry in Manufacturers.

Countries table contains ID, Country and CountryCode fields. i.e. 47, Great Britain & GB

Provinces/States table contains ID, Province/State and CountryCode. as in 1, Alaska and US.

In the form the country is easily selected from a list refering directly to the Countries table.

Problem: How to make a list in the form from which the user can simply select the province for the country that has previously been selected. And not a list with all teh provinces and states from every country in the world. (This would be a really really long list...)

View 3 Replies View Related

Tables :: Lookup Field Using Another Multi Value Lookup Field As Data Source

Nov 23, 2012

how to do a particular thing in Access 2010 (I don't even know if it is possible).

I have a table named PRODUCTS:
ID_PRODUCT (primary key, autonumber long integer)
ALLOWED_OPTIONS (multi value text lookup field: "Option 1";"Option 2";...;"Option 9")

So I can store, for each different product, none, one, or more options to let the customers choose from.

I have a table named ORDERS:
ID_ORDER (primary key, autonumber long integer)
FK_CUSTOMER (foreign key, linked to the primary key of a CUSTOMERS table; represents the customer that places the order.)
FK_PRODUCT (foreign key, linked to PRODUCTS.ID_PRODUCT; represents the product that the customer has choosen)
CHOOSEN_OPTION (lookup text field; the customer must choose ONE option among those allowed for the product he has ordered)

The problem is that I would like the CHOOSEN_OPTION field to show as a combobox, listing the values stored into PRODUCTS.ALLOWED_OPTIONS, so that when a customer buys a product, he can choose only among the options allowed by that particular product.How can I manage a multi value field to populate a combobox, in which every item stays on its line? If I use, as a query to populate the combobox:

select [PRODUCTS].[ALLOWED_OPTIONS]
from PRODUCTS
where [PRODUCTS].[ID_PRODUCT]=[FK_PRODUCT]

I obtain an empty combobox.If I refer to the last field as [ORDERS].[FK_PRODUCT], Access asks me to type a value for "[ORDERS].[FK_PRODUCT]", treating it as an unknown parameter.I think that the problem is that when the combobox expands, the record is not committed yet, so FK_PRODUCT is unknown (NULL?). But this happens even if I commit the record typing something in FK_PRODUCT and then I re-enter the record and I expand the CHOOSEN_OPTION combobox, that is still empy although FK_PRODUCT exists, now.Is there a particular syntax to refer to a field in a record not committed yet (something like "THIS." or "ME.")?

View 5 Replies View Related

Modules & VBA :: Restrict Value In Lookup Field To Only Include Values From Table B Not In Table A?

Feb 2, 2014

I have a database that has 2 tables. Table A and Table B. Table A is my primary table. On this table I have 2 fields. The first field is a LOOKUP Field that looks up information from Table B and displays my selection in the field on Table A. Then using DLOOKUP I automatically input the information in the Second Field on Table A based upon the selection from the First Field.

This is working mostly correctly. However, the problem is, when I click on the next record in the table, it automatically changes the Second Field on that record to the same value as the record before it and continues this trend each time I click on another record. This occurs without me making a selection in the first field. If I make a selection in the first field it does change the Second Field to the Correct Value, but then the next Record has the same issue.

How do I go about fixing this so it doesn't change the value with the change of the record. Only change if I change that particular field within that 1 record?is there a way to restrict the Value's in my lookup field to only include the Values from Table B that aren't already in Table A?

View 5 Replies View Related

Field & Lookup Table

Jan 6, 2006

I am very new to Access and any help would be appreciated. I have been through the entire Access Bible and many forums but can't find the answer to my specific question.

The project:

I'm setting up a database for tutors and students. Tutors will, via the web, enter data about a specific tutoring session (studentName, subject, sessionLength, etc.) Then at the end of the month a report will be generated detailing hours tutored and total compensation.

The problem:

Students pay varying rates based on subject (math or verbal). So in the Session table each record for each tutoring session has an empty field called payRate. This is the rate the student will pay based on subject. So I need this field to "fill in" automatically based on the 'student' and the 'subject' from the same record. Then I can multiply the field by sessionLength and get a totalPay field for the session. Add these at month's end and pay the tutors.

I've set up a lookup table called 'subject' with three fields (student,subject, payRate) and I have the student and subject combined as the primary key. Am I on the right track here? If so, how do I link the tables to get that Session 'payRate' field to fill in automatically. This is where is breaks down for me. I've tried the lookup wizard but all I seem to get when I open the Session table is an empty PayRate field with a drop down box containing the entire subject lookup table.

Sorry for being so long winded but I need help from someone better at his than me. Thanks in advance.

View 2 Replies View Related

Lookup Field In A Table

Jan 12, 2008

hi, plz i need a fast help
i have 3 tables in access:
Country Table: fields:country Id, country name

City Table: fields: City ID,Country Name(lookup field to Country Table), City Name

Street Table: fields: Street Id, country name(lookup field to Country Table), City Name(must be lookup to City Table where City.Country name = Street. Country name), street name

my question is: how can i make the lookup of the City Name in the Street Table, in a way that only cities of the specific country of the record active are displayed ???
example:
Country table:
1 Lebanon
2 KSA
3 Kuwait

City Table:
1 KSA jeddah
2 KSA Riyadh
3 Lebanon Beirut
4 Lebanon Tripoli

STreet Table:
1 KSA (???) Sary (the ?? must be a combo Box that show only the cities of KSA: jeddah, Riyadh..which are in the City Table)
2 KSA (???) sondos (same as above)
3 Lebanon (???) hamra (the ??? must be a combo box that show only the cities of lebanon: Beirut and tripoli...which are in the city Table)

i have created all the fields in these tables...and when i put the field City Name as lookup, i am failing to mak eit read correctly from the city table according the the country of my active record..
plz anybody knows how to do this query???

View 2 Replies View Related

Calculation With Lookup Field In Another Table

Dec 3, 2014

My Sales! table has fields [ItemType] and [Price] and VAT! table has [ItemType] and [VATRate].

Both tables has a common field which is [ItemType].

I am trying to make a query which will calculate the VAT figure by multiplying the Sales table [Price] with the corresponding [VATRate] in the VAT table by matching the [ItemType] in both tables.

I tried DLookup but couldn’t find a solution. How do I accomplish this?

View 1 Replies View Related

Multi-value Lookup Field To A Table

Mar 11, 2014

I'm having a big struggle with adding a multi-value lookup field to a table. I need to provide a long pick list of items (from a source table) but these items must not be output (in forms or reports) in alphabetical order, they need to remain in the order that they are in the source table.

Access wants to alphabetize the output even if a I add a number field to the source table and sort by that.

Is there any way I can persuade access to just give the selected items back in the same order as in the source table ?

View 14 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

Tables :: How To Make Calculated Field Based On Field In Another Table

Jun 18, 2014

Table1 contain Two fields (3Months) and (6Months)

Table2 contain Two fields (3Months) and (6Months)

the table 2 is the source of a form that will let the user change the numbers. table 1 should change Date1 and Date2 Fields based on the two fields (3months) and (6months) if i want to make a lookup wizard it should be changed manually and if i make a calculated field i can't find other tables in the expression builder

View 1 Replies View Related

Multiple Lookup Values Into One Table Field

Apr 4, 2006

Hi,

Is there anyway to have a single field in a table which is populated via the use of a lookup onto another table, but allowing multiple value selection out of the lookup table and populating those into the field...

For example

Table 1 is customer details
Table 1 field 3 = areas of interest

Table 1 field 3 is populated via a lookup into Table 2 interests

Table 2 has 4 records

Sport
Household
Motoring
Family

I want to be able to select 1 or more of the Table 2 values and populate them into Table 1 Field 3....

Help my head hurts....

View 3 Replies View Related

Tables :: Sorting Table Field With Lookup

Aug 12, 2015

I have created a lookup in a field in a table:

select id, bike from tblbikes.
Column count 2
Width 0,3

When I try to sort the table by bike:

I receive the following error: Type mismatch in expression.

Is there some way to sort a field with a lookup.

View 3 Replies View Related

General :: Lookup Into A Table - Populate Same Field

May 28, 2014

I have a table holding a list of post codes, and their servicing depot EG -

ID Postcode Depot
1 AB10 Edinburgh
2 AB11 Edinburgh

Then a form, which has a field for depot ( Fld_Depot )

What i would like is, when the user clicks on the field, a msg box prompts, asking for them to input a postcode

Once the postcode is entered, it populates that field with the relevant depot from the table....

View 3 Replies View Related







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