Auto Populate dates

  • Thread starter Thread starter mustangchic2006
  • Start date Start date
M

mustangchic2006

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
 
mustangchic2006 said:
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.
 
Back
Top