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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Need Help...



 
 
Thread Tools Display Modes
  #1  
Old March 7th, 2010, 12:51 PM posted to microsoft.public.access
Nad
external usenet poster
 
Posts: 60
Default Need Help...

I have two tables TblEmp and TblEmpService with a common field EmpID.
TblEmp has the fields: EmpID, EmpName and Site. A form is attached to this
table to enter new or edit existing employee.
TblEmpService fields are : EmpID, EmpName, ServiceType,Site..etc
I made a form based on TblEmpService in which all the fields is there from
tblEmpService.
What I want is that if I put Employee ID in the EmpID text Box the Employee
Name should come in the EmpName text Box from the TblEmp. Also this Emplyee
ID should store in the TblEmpService.
Thanks & Regards,

  #2  
Old March 7th, 2010, 02:07 PM posted to microsoft.public.access
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default Need Help...

hi Nad,

On 07.03.2010 13:51, Nad wrote:
I have two tables TblEmp and TblEmpService with a common field EmpID.
TblEmp has the fields: EmpID, EmpName and Site. A form is attached to this
table to enter new or edit existing employee.
TblEmpService fields are : EmpID, EmpName, ServiceType,Site..etc

Normally you don't need to store the name and the site redundantly.
I would recommend a table structure like this:

Employee:
ID AutoNumber, Primary Key, Not Null
Name Text(255), Not Null

ServiceType:
ID AutoNumber, Primary Key, Not Null
Name Text(255), Not Null

Site:
ID AutoNumber, Primary Key, Not Null
Name Text(255), Not Null

Service:
ID AutoNumber, Primary Key, Not Null
idEmployee Number(Long), Not Null
iderviceType Number(Long), Not Null
idSite Number(Long), Not Null
etc..

The primary key is a combined key over idEmployee, idServiceType and
idSite.

Build the foreign keys according to the field names in the service table.

What I want is that if I put Employee ID in the EmpID text Box the Employee
Name should come in the EmpName text Box from the TblEmp. Also this Emplyee
ID should store in the TblEmpService.

Build a new form based on the service table. Place a ComboBox for each
foreign key field. Bound it on that corresponding idTableName field.
Change the RowSource of these ComboBoxes to the corresponding table. Set
the Bound Field to 1, the Column Count to 2 and Column Widths to 0;5.


mfG
-- stefan --
  #3  
Old March 7th, 2010, 10:44 PM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Need Help...

On Sun, 7 Mar 2010 04:51:01 -0800, Nad wrote:

I have two tables TblEmp and TblEmpService with a common field EmpID.
TblEmp has the fields: EmpID, EmpName and Site. A form is attached to this
table to enter new or edit existing employee.
TblEmpService fields are : EmpID, EmpName, ServiceType,Site..etc
I made a form based on TblEmpService in which all the fields is there from
tblEmpService.
What I want is that if I put Employee ID in the EmpID text Box the Employee
Name should come in the EmpName text Box from the TblEmp. Also this Emplyee
ID should store in the TblEmpService.
Thanks & Regards,


You're mistaking how relational databases work. The employee name should exist
in TblEmp - and *NOPLACE ELSE*. Relational databases use the "Grandmother's
Pantry Principle": "A place - ONE place! - for everything, everything in its
place." You would store the name once (preferably as two fields LastName and
FirstName, perhaps middlename, Title and Suffix fields as well), and then use
Forms and Queries to tie them together. Table datasheets should *not* be used
for viewing or editing data, they're very limited.

See some of the tutorials he

Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/acc...resources.html

The Access Web resources page:
http://www.mvps.org/access/resources/index.html

Roger Carlson's tutorials, samples and tips:
http://www.rogersaccesslibrary.com/

A free tutorial written by Crystal:
http://allenbrowne.com/casu-22.html

A video how-to series by Crystal:
http://www.YouTube.com/user/LearnAccessByCrystal

MVP Allen Browne's tutorials:
http://allenbrowne.com/links.html#Tutorials

--

John W. Vinson [MVP]
  #4  
Old March 13th, 2010, 05:42 PM posted to microsoft.public.access
De Jager
external usenet poster
 
Posts: 393
Default Need Help...


"John W. Vinson" wrote in message
...
On Sun, 7 Mar 2010 04:51:01 -0800, Nad
wrote:

I have two tables TblEmp and TblEmpService with a common field EmpID.
TblEmp has the fields: EmpID, EmpName and Site. A form is attached to this
table to enter new or edit existing employee.
TblEmpService fields are : EmpID, EmpName, ServiceType,Site..etc
I made a form based on TblEmpService in which all the fields is there
from
tblEmpService.
What I want is that if I put Employee ID in the EmpID text Box the
Employee
Name should come in the EmpName text Box from the TblEmp. Also this
Emplyee
ID should store in the TblEmpService.
Thanks & Regards,


You're mistaking how relational databases work. The employee name should
exist
in TblEmp - and *NOPLACE ELSE*. Relational databases use the
"Grandmother's
Pantry Principle": "A place - ONE place! - for everything, everything in
its
place." You would store the name once (preferably as two fields LastName
and
FirstName, perhaps middlename, Title and Suffix fields as well), and then
use
Forms and Queries to tie them together. Table datasheets should *not* be
used
for viewing or editing data, they're very limited.

See some of the tutorials he

Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/acc...resources.html

The Access Web resources page:
http://www.mvps.org/access/resources/index.html

Roger Carlson's tutorials, samples and tips:
http://www.rogersaccesslibrary.com/

A free tutorial written by Crystal:
http://allenbrowne.com/casu-22.html

A video how-to series by Crystal:
http://www.YouTube.com/user/LearnAccessByCrystal

MVP Allen Browne's tutorials:
http://allenbrowne.com/links.html#Tutorials

--

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 07:03 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.