I
Ilan
I was wondering what's the correct way of binding forms. Here is what I do:
Say I have two tables with 1-to-many relationship as follows.
tblAxes
AxisName[PK1]
tblCountries
AxisFK [PK1]
CountryName [PK2]
I want to have a mainform/subform as follows. User selects the Axes name
from a combo box on the main form. Then on the subform he sees a datasheet
of all the existing countries belonging to the Axis. He is then free to add
or remove countries. EG, user selects 'Evil' from the Axis combobox, and
sees the countries Iran, Iraq, and North Korea on the datasheet. User then
is free to remove Iraq and add Syria, for example.
This is the way I link (or bind?) the forms. I write a query in which all
the records and axis are selected (eg SELECT * From inner join of both
tables) and I call this query 'qryCountriesInAxis'. Then, on the 'form'
object of both the main form and the subform, I set the 'Record Source'
property to 'qryCountriesInAxis'.
This seems to work for me. I can then use the 'List Master Fields' and
'List Child Fields' properties to link the two queries together.
My question is: am I going about this in an efficient manner?
Many thanks
Ilan
Say I have two tables with 1-to-many relationship as follows.
tblAxes
AxisName[PK1]
tblCountries
AxisFK [PK1]
CountryName [PK2]
I want to have a mainform/subform as follows. User selects the Axes name
from a combo box on the main form. Then on the subform he sees a datasheet
of all the existing countries belonging to the Axis. He is then free to add
or remove countries. EG, user selects 'Evil' from the Axis combobox, and
sees the countries Iran, Iraq, and North Korea on the datasheet. User then
is free to remove Iraq and add Syria, for example.
This is the way I link (or bind?) the forms. I write a query in which all
the records and axis are selected (eg SELECT * From inner join of both
tables) and I call this query 'qryCountriesInAxis'. Then, on the 'form'
object of both the main form and the subform, I set the 'Record Source'
property to 'qryCountriesInAxis'.
This seems to work for me. I can then use the 'List Master Fields' and
'List Child Fields' properties to link the two queries together.
My question is: am I going about this in an efficient manner?
Many thanks
Ilan