PC Review


Reply
Thread Tools Rate Thread

Automatic output from two linked tables

 
 
=?Utf-8?B?TWlja2V5?=
Guest
Posts: n/a
 
      30th Mar 2006
I am compiling a form for personnel records. I want to show the department
and the code associated with the employee. The department code has been
output from the employee table and I have formatted it as a drop down list.
I would like to have the department description, which is located in another
table. I have created a relationship between the two tables, employee and
chartofaccounts. I was able to create a combo box with a drop down list
which can be used for choice of description but would like to have an
automatic input to the employee form so that the person using this form would
not need to search the drop down list. Is this possible and how??
 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2xhdHV1?=
Guest
Posts: n/a
 
      30th Mar 2006
There are two places in your form module you will need to add code.
First, in the Current event so it will get the department description each
time the current record changes. You will, however, have to be sure you are
not on a new record, because at that time, the department code in your form
will be Null.

If Not Me.NewRec Then
Me.txtDeptDescription = DLookup("[Description]", "DeptTable",
"[DeptCode] = '" & Me.DeptCode & "'")
End If

Then, you will want to do the same thing in the After Update event of your
form control where the Department code is so it will handle new records and
changes to current records.

Note, all the names above are made up. Substitue the correct names for your
controls, tables, and fields.

"Mickey" wrote:

> I am compiling a form for personnel records. I want to show the department
> and the code associated with the employee. The department code has been
> output from the employee table and I have formatted it as a drop down list.
> I would like to have the department description, which is located in another
> table. I have created a relationship between the two tables, employee and
> chartofaccounts. I was able to create a combo box with a drop down list
> which can be used for choice of description but would like to have an
> automatic input to the employee form so that the person using this form would
> not need to search the drop down list. Is this possible and how??

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Appending Records from Linked Tables to the *Real* Linked Tables tbl Microsoft Access Queries 2 22nd Jun 2006 01:42 AM
Linked Table Manager Not Showing List of Linked Tables Don Microsoft Access External Data 4 19th Oct 2005 02:21 PM
Re: How to add linked tables objects to this access query output? Marshall Barton Microsoft Access Queries 0 14th Jul 2005 04:56 PM
How to add linked tables objects to this access query output? tonyck Microsoft Access Queries 0 14th Jul 2005 11:46 AM
Automatic Refresh of Linked tables Jake Microsoft Access External Data 3 8th Sep 2004 05:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:01 PM.