473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Problem with lookup field in tables and forms

I am building an employee database in access 2007, I have put employee names, identified with an ID, the fields are identified as first name and last name 2 seperate fields. Question is this... When creating a lookup Column in a form or other table the names show up in two columns which is fine but when a name is selected only the first name or last name appears not both? I am a beginner with access but am quickly grasping the concept and see this as a learning opportunity so any help with this more than likely simple problem would be great thanks.
May 2 '10 #1

✓ answered by NeoPa

That's straightforward enough. The bound field (the field in the table that the form's ComboBox control is associated with) can only take a single value from the control, but if the control were unbound, you could have code in the AfterUpdate event of the ComboBox which takes both values from it (the .Column method of the ComboBox) and mixes them together as you'd like, then assigns the resultant value to a control (TextBox) which is bound to the field you want to maintain.

4 2527
NeoPa
32,556 Expert Mod 16PB
It's hard to know exactly how to answer this as I'm not sure why you might have a problem with the concept of returning a single value. How would you conceive of a single control having two separate values? Maybe that's just that I think along lines more naturally in synch with Access or any RDBMS.

Perhaps if you filled the picture out a little more we could determine what you're actually trying to achieve, and possibly find a more natural approach for you.

Welcome to Bytes!
May 2 '10 #2
I understand the single value, I guess what is frustrating is a template I downloaded had this ability to pull data from 2 fields and place in 1 field and i can't figure out how they did it. The template did not fit my needs so I kind of used it as a guide to design my own, maybe the solution to my problem is finding another way to bring in the data from 2 fields and posting in one single field in a table?
May 2 '10 #3
NeoPa
32,556 Expert Mod 16PB
That's straightforward enough. The bound field (the field in the table that the form's ComboBox control is associated with) can only take a single value from the control, but if the control were unbound, you could have code in the AfterUpdate event of the ComboBox which takes both values from it (the .Column method of the ComboBox) and mixes them together as you'd like, then assigns the resultant value to a control (TextBox) which is bound to the field you want to maintain.
May 3 '10 #4
Jerry Maiapu
259 100+
You can put a text box next to the look up column and pull out the other colum value on the afterpudate event. SO that when the a single value is displayed on the lookup cloumn the other value can be shown on the text box.

If you agree ask for the code..

Regards

Jerry
May 5 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jim Stacey | last post by:
Create Lookup field with Visual Basic Can i create a lookup field on the fly? In my table Students i want to create a loookup field TeacherID that looks up teachers by their LastName. Otherwise...
7
by: Marco Simone | last post by:
Hi, What is your opinion about using Lookup field in table. I would like to use lookup field in table 1, so that I can choose data in combo box from table 2. Is this good design of database? ...
1
by: Zachary Turner | last post by:
I want to make a Lookup Field based on another Lookup field. In other words, I have this table A with two fields: ID and Name, where ID is an Autonumber and Name is a friendly name. Then I have a...
1
by: sierra467 | last post by:
I realize that lookup fields in a table should not be used but that is the way this particular creator has done. Could someone help me by answering my question. I am trying to run a...
1
by: LurfysMa | last post by:
I am working on an electronic flashcard program. Most of the subjects are simple lists of questions and answers. Those seem to be working. Some of the "subjects" have "categories" of questions. ...
2
by: computerider | last post by:
I have a standard two-table structure, Orders which has a lookup field to the Salesperson table. However when you build a form the salesperson field has the combo box feature - which I WANT when...
7
by: samdev | last post by:
I have set up a table with a few fields that are set to required....all work fine except the fields that are Lookup from another table. What am I forgetting to set? Thanks!!
1
beacon
by: beacon | last post by:
Hi everybody, I've searched around for answers, but the closest thing I've found referenced the Northwind database and it seems to be set up a little differently than mine. I'm using DAPs (data...
0
geraldinegrieve
by: geraldinegrieve | last post by:
Hi I have a lookup field in a able which I know now I shouldn't have but is there any way I can query this field by text rather than number e.g I have a field "Type of Training" which I would like to...
3
by: roguetexan | last post by:
I have over 1000 records in a table (Context_Tasks_DB), one field of which (termed Purpose) should really be a Lookup to another table (tblPurpose), but currently simply has text (only 30 unique text...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.