A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

auto adding of information



 
 
Thread Tools Display Modes
  #1  
Old January 2nd, 2009, 12:29 AM posted to microsoft.public.access.tablesdbdesign
Andrew
external usenet poster
 
Posts: 688
Default auto adding of information

I am designing a training database and have created tables of officers with
regimental numbers and names.
I have a form which is working well however i want to be able to put in an
officers regimental and the name of the officer be self populated from the
table into the name flield of the form.
  #2  
Old January 2nd, 2009, 12:56 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default auto adding of information

On Thu, 1 Jan 2009 16:29:03 -0800, Andrew
wrote:

I am designing a training database and have created tables of officers with
regimental numbers and names.
I have a form which is working well however i want to be able to put in an
officers regimental and the name of the officer be self populated from the
table into the name flield of the form.


What's the structure of your Tables? The officer's name should exist once and
once only (in the table of officers). That table should have a Primary Key
(which may well be the "regimental number", though I don't know what that
number might be), and should have fields such as LastName, FirstName,
MiddleName, Suffix (e.g. Bailey, Beetle, NULL, Jr.); the name should not be
stored in any other table.

--

John W. Vinson [MVP]
  #3  
Old January 2nd, 2009, 01:27 AM posted to microsoft.public.access.tablesdbdesign
Andrew
external usenet poster
 
Posts: 688
Default auto adding of information

I have two tables at the moment, the main officers table has Regimental
number ( Primary Key) Surname, First Name.

The second table has training completed including Regimental (primary key)
Surname, course completed whch is a dropdown box, completed date and review
date.

Are you saying i should delete the regimental and name from all tables exept
the initial officers details and this will self populate the correct name on
the all forms when a regimental is entered?
"John W. Vinson" wrote:

On Thu, 1 Jan 2009 16:29:03 -0800, Andrew
wrote:

I am designing a training database and have created tables of officers with
regimental numbers and names.
I have a form which is working well however i want to be able to put in an
officers regimental and the name of the officer be self populated from the
table into the name flield of the form.


What's the structure of your Tables? The officer's name should exist once and
once only (in the table of officers). That table should have a Primary Key
(which may well be the "regimental number", though I don't know what that
number might be), and should have fields such as LastName, FirstName,
MiddleName, Suffix (e.g. Bailey, Beetle, NULL, Jr.); the name should not be
stored in any other table.

--

John W. Vinson [MVP]

  #4  
Old January 2nd, 2009, 02:03 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default auto adding of information

On Thu, 1 Jan 2009 17:27:14 -0800, Andrew
wrote:

I have two tables at the moment, the main officers table has Regimental
number ( Primary Key) Surname, First Name.

The second table has training completed including Regimental (primary key)
Surname, course completed whch is a dropdown box, completed date and review
date.


I would recommend NOT using "Lookup Fields" in your Tables. See
http://www.mvps.org/access/lookupfields.htm for a critique. They're not
necessary (ever) and can be really confusing.

Are you saying i should delete the regimental and name from all tables exept
the initial officers details and this will self populate the correct name on
the all forms when a regimental is entered?


The other tables should contain only the regimental number (as a foreign key,
a link to the officers table). You can *DISPLAY* the name on any other form by
using a combo box bound to the regimental number (let's call it cboOfficer);
you might base this combo on a query such as

SELECT RegNo, [Surname] & ", " & [First Name] AS Fullname FROM Officers ORDER
BY Surname, [First Name];

This will show (e.g.)

32267 Aarons, Michael
31558 Barnes, Sarah
22601 Carrons, Bob

in the combo, and store the regimental ID in the table.

In a separate textbox on the form you can display the name by using a control
source

=cboOfficer.Column(1)

The Column property is zero based so it will display the second column
(Fullname) from the selected record of the query.
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.