linked forms- foreign key update

vanny

Registered User.
Local time
Yesterday, 21:43
Joined
Feb 18, 2006
Messages
76
Hi,

i need help regarding linked forms..

i have a combo box in a form, where one has to select a country for example UK is chosen, then there is a button that when clicked it opens in a pop-up form and displays all the information related to UK.

so there are two tables : Country (CountryNo : primary key) linked to CountryInfo (CountryNo: foreign key) linked with a one- to -many relationship.

my problem is when you have to add new records to the form CountryInfo, how can i make the foreign key update automatically? thus when adding data to CountryInfo, the CountryNo must be the same to the CountryNo in the CountryTable..

any help will be appreciated thanks a lot.
 
If you displayed the CountryInfo in a SubForm on your MainForm and had the LinkChild/MasterFields set up correctly, then Access would take care of that little task for you.
 
Hi, no it is not a sub form on the main form, it is another form on the main form linked by pressing a button..
 
hi thanks that worked...

now if i want to delete the whole record, by creating a delete button, I have to include code as well? as when i created a delete button and tried to delete, it re-appears when the form is refreshed.
 

Users who are viewing this thread

Back
Top Bottom