By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,500 Members | 2,520 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,500 IT Pros & Developers. It's quick & easy.

Problem with lookup field in tables and forms

P: 2
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.

Share this Question
Share on Google+
4 Replies


NeoPa
Expert Mod 15k+
P: 31,186
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

P: 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
Expert Mod 15k+
P: 31,186
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
100+
P: 259
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

Post your reply

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