PC Review


Reply
Thread Tools Rate Thread

Auto Populate dates

 
 
mustangchic2006
Guest
Posts: n/a
 
      11th Nov 2008
I have two tables :

Class_Registration
ID (PK auto num)
Employee_Name
Department
Extension
Class_Name
Class_Date

Class_Information
ID (PK Auto num)
Class_Name
Class_Date

What i need to do is if they select a class_name, the associated date from
Class_information needs to populate in the class_date field in
class_registration. I was wondering if someone could possibly lead me in the
right direction for this, i would Greatly appreciate it.

Thanks so much!
Courtney
 
Reply With Quote
 
 
 
 
Dirk Goldgar
Guest
Posts: n/a
 
      11th Nov 2008
"mustangchic2006" <(E-Mail Removed)> wrote in
message news:91BC694E-5599-4DCC-A8AC-(E-Mail Removed)...
>I have two tables :
>
> Class_Registration
> ID (PK auto num)
> Employee_Name
> Department
> Extension
> Class_Name
> Class_Date
>
> Class_Information
> ID (PK Auto num)
> Class_Name
> Class_Date
>
> What i need to do is if they select a class_name, the associated date from
> Class_information needs to populate in the class_date field in
> class_registration. I was wondering if someone could possibly lead me in
> the
> right direction for this, i would Greatly appreciate it.



This is easy enough to do by using a second, Class_Date column in the combo
box from which they choose the class, and moving the data in that column to
the Class_Date field in the combo box's AfterUpdate event.

BUT why do it? Why store the Class_Date redundantly in the
Class_Registration table? Is it permissible for the registration's class
date to be different from the class's class date? If not, it's a bad idea
to store it in the Class_Registration table. Think how easy it would be for
them to get out of sync.

Instead, just use a query to look up the class date wherever you need it.
Store the Class ID, not the name, in the Class_Registration table, settring
up your combo box so that it stores the ID, not the name. Base your form on
a query that joins the two tables on the Class ID field, and bind the
Class_Date text box to the Class_Date field from the Class_Information
table. It will automatically be looked up from the table when you set the
ClassID field via your combo box.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
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
Auto-populate other cells based on dates Freddy Microsoft Excel Programming 1 27th Oct 2009 09:21 PM
Auto-populate cells based on dates Freddy Microsoft Excel Programming 1 27th Oct 2009 08:55 PM
Auto-populate other cells based on dates Freddy Microsoft Excel Programming 2 27th Oct 2009 06:46 PM
auto populate dates dusty Microsoft Excel Worksheet Functions 1 15th Jul 2008 05:14 AM
Auto populate dates waiter11 Microsoft Excel Misc 2 28th May 2006 09:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:58 PM.