Add listbox to form for multiple selections

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Access2003-I have a DB that logs certain events when a vehicle is deployed.
Each deployment is a record of events during that deployment and a subform
collects the events information.
Now, I need to add names to the primary form by way of a list box. There
could be two or more names that were in the vehicle during the deployment
that must be recorded in the record. At this time I do not have a table of
these names and I would like some advice as to how to proceed. First I need
to add a field to the tblAgency (Basic info for each deployment) but from
here on I need some help.
Thanks,
 
Hi Dan

For this you need what Microsoft in Access 2007 calls "Complex Data" and
what the rest of us for years have been calling a "Many to many
relationship".

Basically, you have three tables - one for Deployments, one for names
(Staff?) and a "junction table" which contains two fields - one for the
primary key value of the deployment and one for the PK value of the person
in the vehicle.

Traditionally in Access, such a design is handled by using a subform for the
DeployedStaff records, but I have written a class module to make it easy to
perform data entry and maintenance using a listbox and combo box and minimal
code.

You can download the a sample database from here:
http://www.accessmvp.com/KDSnell/SampleDBs.htm#NotSoComplex

Post back if you have any problems or further questions.
 
Thank you Graham. I will study Complex data and work on it this week.
Dan

Graham Mandeno said:
Hi Dan

For this you need what Microsoft in Access 2007 calls "Complex Data" and
what the rest of us for years have been calling a "Many to many
relationship".

Basically, you have three tables - one for Deployments, one for names
(Staff?) and a "junction table" which contains two fields - one for the
primary key value of the deployment and one for the PK value of the person
in the vehicle.

Traditionally in Access, such a design is handled by using a subform for the
DeployedStaff records, but I have written a class module to make it easy to
perform data entry and maintenance using a listbox and combo box and minimal
code.

You can download the a sample database from here:
http://www.accessmvp.com/KDSnell/SampleDBs.htm#NotSoComplex

Post back if you have any problems or further questions.
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Dan said:
Access2003-I have a DB that logs certain events when a vehicle is
deployed.
Each deployment is a record of events during that deployment and a subform
collects the events information.
Now, I need to add names to the primary form by way of a list box. There
could be two or more names that were in the vehicle during the deployment
that must be recorded in the record. At this time I do not have a table of
these names and I would like some advice as to how to proceed. First I
need
to add a field to the tblAgency (Basic info for each deployment) but from
here on I need some help.
Thanks,
 
Hi Dan

It's really not at all scary. Note that my sample database is called
"NotSoComplex" :-)
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Dan said:
Thank you Graham. I will study Complex data and work on it this week.
Dan

Graham Mandeno said:
Hi Dan

For this you need what Microsoft in Access 2007 calls "Complex Data" and
what the rest of us for years have been calling a "Many to many
relationship".

Basically, you have three tables - one for Deployments, one for names
(Staff?) and a "junction table" which contains two fields - one for the
primary key value of the deployment and one for the PK value of the
person
in the vehicle.

Traditionally in Access, such a design is handled by using a subform for
the
DeployedStaff records, but I have written a class module to make it easy
to
perform data entry and maintenance using a listbox and combo box and
minimal
code.

You can download the a sample database from here:
http://www.accessmvp.com/KDSnell/SampleDBs.htm#NotSoComplex

Post back if you have any problems or further questions.
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Dan said:
Access2003-I have a DB that logs certain events when a vehicle is
deployed.
Each deployment is a record of events during that deployment and a
subform
collects the events information.
Now, I need to add names to the primary form by way of a list box.
There
could be two or more names that were in the vehicle during the
deployment
that must be recorded in the record. At this time I do not have a table
of
these names and I would like some advice as to how to proceed. First I
need
to add a field to the tblAgency (Basic info for each deployment) but
from
here on I need some help.
Thanks,
 
Back
Top