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

Primary Key to Equal Foreign Key and Autoupdate

I am using access 2000.

I have two questions

Question 1

I have 3 tables. tblFlight, tblAircraftType, tblFlightProgramIN/OUT.

tblFlight has a 1 to many relationship with tblAircraftType, tblFlightProgramIN/OUT.

I have used tblFlight Pk FlightID as the foreign key in tblAircraftType and

tblFlightProgramIN/OUT.

However, I was testing some data and realised that the value of the tblFlight PK FlightID key does not autoupdate to equal the value of the FK FlightID in the tblAircraftType, tblFlightProgramIN/OUT.

Is this correct? Should'nt they have the same value eg tblFlight.FlightID =1(PK)
tblAircraftType.FlightID=1(FK)

Question 2

I am implementing a Global Popup Calendar from the following link.

http://www.fontstuff.com/access/acctut09.htm

However I get an error that says "You entered an expression that has no value".
When I hover the debugger over the value I get an error that says You "cboOriginator.Value has no starting value".
I entered a default value of Date() in the properties section of the cboOriginator.Value(combobox on the form). But I still get the same error.

I entered a test value in the table that links to the combobox but still get the same error.
Before I made the calendar cboOriginator a Global Variable it worked ok.

However I am using a number of comboboxes on the form to pick dates from each day of the week corressponding to arrival and departure dates eg.

Arrival Date:
Monday(cboArrivalDate1) Tuesday(cboArrivalDate2
Departure Date:
Monday(cboArrivalDate1) Tuesday(cboArrivalDate2

The name of my combobox is cboArrivalDate1.Value
Here is the code below.



Here is a the code below

Private Sub cboArrivalDate1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Set cboOriginator = cboArrivalDate1
ocxCalendar5.Visible = True
ocxCalendar5.SetFocus
If Not IsNull(cboArrivalDate1) Then
ocxCalendar5.Value = cboArrivalDate1.Value
Else
ocxCalendar5.Value = Date
End If

End Sub
Mar 24 '07 #1
1 2226
Rabbit
12,516 Expert Mod 8TB
In response to question 1, do you mean that you want it to update the foreign key values if you change the primary key value? To do you you have to set up referential integrity in the relationship between the tables. You can view the relationships from Tools > Relationship.
Mar 24 '07 #2

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

Similar topics

1
by: Lannsjo | last post by:
I need to change my primary key column type from smallint to int. I have tried: ALTER TABLE livegroup MODIFY id INT UNSIGNED NOT NULL AUTO_INCREMENT; But get an error message certainly since my...
3
by: William D. Bartholomew | last post by:
I'm working on a system that is very address-centric and detection of duplicate addresses is very important. As a result we have broken addresses down into many parts (DDL below, but I've left out...
6
by: Andreas | last post by:
Hello list, what about uniqueness of inherited primary keys ? eg you have : create table objects ( id int4, date_created timestamp(0), primary key (id)
4
by: Fred | last post by:
Hi. What is the usual and what are the possible fields to use for the primary key of an intersecting table of a many-to-many relationship? I would think the typical, most common fields would...
13
by: Tibor | last post by:
I am using PostgreSQL 7.4.1 (only through psql) I know, that the command ALTER TABLE OFFICES DROP PRIMARY KEY (CITY); and its foreign key equivalent: ALTER TABLE SALESREPS DROP CONSTRAINT
9
by: sonal | last post by:
Hi all, I hv started with python just recently... and have been assigned to make an utility which would be used for data validations... In short we take up various comma separated data files for...
3
by: Rick Kay | last post by:
I have a table that has a Primary key and a foreign key. The primary key is NOT an Identity field, however, the foreign key is. I would like to know if there is a way to have the foreign key reset...
6
by: ravichoudhari | last post by:
i came accross requirement of multiple foreign keys in a table referencing the same primary key another table. i created the table relations using the relations editor in access. even though i...
4
by: Peter | last post by:
I am interested in informed feedback on the use of Constraints, Primary Keys and Unique. The following SQL statement creates a Bands tables for a database of bookings Bands into Venues, where the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.