473,320 Members | 1,961 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,320 software developers and data experts.

2 Lookup controls on Form

Hi there, am confused. Am wondering if you have a lookup control on the form and it populates the form with the selected Employee Name and all other pertinent data, is there a way to have 2 lookup fields (one for Employee Name, and one for Employee ID) and when you make a selection from the Employee Name lookup control have it populate the form and also the Employee ID control with the correct Employee ID? Am also wondering if you make a selection from the Employee ID lookup control and have it do the same for the form fields as well as the Employee Name.


Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo83_AfterUpdate()
  2.     ' Find the record that matches the control.
  3.     Dim rs As Object
  4.  
  5.     Set rs = Me.Recordset.Clone
  6.     rs.FindFirst "[EMP_ID] = '" & Me![Combo83] & "'"
  7.     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
  8. End Sub
  9.  

Expand|Select|Wrap|Line Numbers
  1. Row Source for  Employee Name
  2. SELECT T_EMPLOYEE.EMP_ID, T_EMPLOYEE.EMP_NAME FROM T_EMPLOYEE; 
  3.  

Expand|Select|Wrap|Line Numbers
  1. Row Source for Employee ID
  2. SELECT T_EMPLOYEE.EMP_ID FROM T_EMPLOYEE; 
  3.  

Thank you VERY much for your assistance
Nov 21 '08 #1
1 1190
hi,

you may want to use cascading combo to look up the data you need base on employee id or employee name... here you''ll have to use a combo box.

you can check the concept in the link below.

Cascading Combo/List Boxes - bytes

regards,
cindy
Nov 25 '08 #2

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

Similar topics

3
by: my-wings | last post by:
I've been reading about how evil Lookup fields in tables are, but I've got to be missing something really basic. I know this subject has been covered before, because I've just spent an hour or two...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
0
by: mjsterz | last post by:
I've been working with VB .NET for less than a year and this is the first time I've posted on one of these groups, so let me apologize beforehand if I'm being unclear, not posting my issue...
1
by: DoctorV3774 | last post by:
I need a function to do the following when opening a Form named NewFrm_MainTemplate. I need the function to look at the user id of the person attempting to open the form. Their Windows user ID...
3
by: john | last post by:
In my form (table A) I have subform (table B (only 2 fieds: ID and App_name) where table A -Table B are linked 1XM. To be able to add a record in the subform I want to use a lookup form since the...
1
by: keri | last post by:
Hello again, I am trying to have a lookup box on a form that dependant on the answer populates the next lookup box and so on. I am presuming I need to do this via a form, and create a one to...
7
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm...
0
by: Andrus | last post by:
I tried to use modeless picklist for DataGridView custom ComboBoxColumn without success. Steps to reproduce issue: 1. Run code 2. Enter some character 3. Press Tab Observed:
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...
0
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...
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: 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...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.