Accident Investigation Database - Need Help With Relationships/keys Please

Jan 23, 2008

Hi all. I'm currently freelancing for a accident investigation company and they require a database. What the database needs to do is:

1.Hold client details
2.Hold Case details
3.Hold Invoice/costing details
4.hold expense details

The case table is the centre of the database and links to all the other information. I require: multiple clients per case, multiple invoices per case, multiple casecostings per invoice, and multiple expenses per case.

I have set up the tables to what i think is correct, but now find that when trying to link tblCase and tblExpenses, I am getting the error "Invalid field definition "ExpenseID" in definition of index or relationship". I think this may be something to do with my keys, but can't seem to figure out a way around.

I've attached my DB, if anybody could take a quick look at it and tell me where i'm going wrong i would be eternally grateful. Thanks guys.

View Replies


ADVERTISEMENT

Lost Relationships & Primary Keys

Jun 6, 2007

I'm having lots of erratic problems with our Access database. Back end tables on the server, front ends on workstations. Running Windows 2000 server, Access 2003 SP2 on Windows XP SP2. I'm not the network administrator so don't have much detail on network. For instance, the back end is 'losing' relationships between tables, with the primary key on the 'one' end of a 'many' relationship disappearing - the relationship link between the tables also disappears. Other errors are:- erratic problems with indexes which are sometimes fixed with a compact / repair, sometimes not- data on forms disappearing- data on forms appearing in the wrong field- queries that ask for parameter input twice when only programmed to so once- sorting orders suddenly going wrong way round - inability delete a record via a form, caused Access to completely crash with Microsofts 'sorry unrecoverable error' message. To fix the query problem, I created a blank query and imported the old one into it, problem solved. But what caused the old query to act weird in the first place?To fix the inability to delete a record problem, I created a whole new blank database and imported everything into it. But what caused the database to repeatedly crash? The suddenly missing relationships I have no cure for. I'm at the end of my tether - can't figure out any pattern to this. Any suggestions? Network errors? Read / write on server? Disk space / fragmentation? Fundamental problem with the database?Any help much appreciated.Sorry if this post should have been in the tables forum.

View 6 Replies View Related

Supermarket Database... Unsure About Relationships

Mar 31, 2006

Is this relationship correct (see attachment)? When i create an orders query with the fields:-Barcode number (source: orders/products table)Product name (source: products table)Quantity (source: orders/products table)Unit price (source: products table) Total (calculated - [Unit price]*[Quantity] )it does not allow data entry for barcode number and quantity (product name and unit price should appear automatically when barcode no. entered) why is that? and how could i resolve this? attached also is my database to see what i mean... if u have time can u please make the modifications NEEDED and send me the modified one, if not just give me a textual description of what i should do..... (btw it is actually a school canteen system databse, thats why i have customerID field as student administration number or staff initials)please reply soon.. this is urgentthank you

View 1 Replies View Related

Setting Up Database - Need Help With Relationships Between Tables

Sep 9, 2007

Hi,

I would like to create a small HR database that holds:

* Employee details (Name, Date of birth, Entry Date, Exit Date, Function,Department, Shift)
* Departments
* Departments and capabilities needed
* Employee, departments and capability achieved (1=yes, 0=no)

The idea would be to have a link between the employee the departments capabilities I can tick fields of the capabilities they have or have achieved.

When I have this I could run a report that shows a score per employee
For example:

Name: Department: Orderpicking: Packing: Cutting:

John Warehouse 1 1 0

As the tasks / capabilities required are different per department you would see something different if you would have user Jane that works in accounting


Is there anyone that can give me some hints so that I can get any further??

For the moment I have 3 tables:

1. Employee information - John, Jane
2. Departments - Warehouse, Accounting
3. Department tasks - Department, Cap1, Cap2, Cap3, Cap4

View 7 Replies View Related

Database Issues, Table Relationships

Sep 24, 2007

Hi All,

My name is Paul and I am new to this Forum, so I firstly wanted to say hello to all and glad to be here.

I need some assistance with a work related database. I am currently developing it as a project but have run into a wall with the design being my first time.

I have to create a customer service and invoicing database. I currently have the following tables:

Client (Customer No, User Profile, Password, Customer Name, Acc No, Policyholder, 100% Indemnity)

Contact (Acc No, Date Signed On, Company Name, Contact Name, Address 1, Address 2, Address 3, Address 4, Address 5, Post Code, Telephone No, Fax No, Email)

Product (Product ID, Product Name, Service Level, Product Code, Price, Subscription Details)

Client / Price (Customer No, Product ID)

Usage (Order Number, Day, Month, Year, Subject Name, Client Reference, Product Code, Company Name, Customer No)


I have managed to link Client and contact no problems at all. I have also managed to link Client to Product using the table Client / Price.
I have tested this with queries and can get all of the data I need extracted out.

However the problem occurrs when I try and link the Usage table to something or other. The Usage table is data that I need to import on a monthly basis from Excel. Once I get it, I need to load it into Access and then generate usage statements for each of the clients to show what products they have ordered and how much each report has cost them.

To make matters worse, each client has 14 different products to choose from, and all clients have different prices for each of the different products.

Getting this to connect properly is an absolute nightmare.

Can anyone assist me in how I might link the Usage (imported table) to the rest of the database? I have attached a copy of the relationships on a word document and wonder if anyone can put a finger on what I might be doing wrong.

Hope someone can help.

View 14 Replies View Related

Designing Database Table And Relationships?

Feb 14, 2012

I want to design a database for an educational instution environment. My problem is knowing what tables to create and how to link them. I know for example that an instructor can teach more than 1 course and a course can be taught by more than 1 Instructor. This makes it a many to many relationship which is not remommended. I know that there has to be another table to bridge these 2 tables. I want to know what is a suitable name for this 3rd table and what example fields it should contain besides the the Keys form table 1 and 2?

Now here is the over all problem:some instructors teaches more than 1 subjectsome subjects are taught by more than 1 Instructorsome Classes are taught by more than 1 instructorsome instructors teach more than1 classSome classes do more than 1 subjectSome subjects are done by more than 1 ClassSome classes are done at more than 1 locationThis is what is needed:

To be able to enter student grades and attendances by classThe marks sheet should be entered in a subform displaying the full student names list for a particular class at a time.

2. To be able to display the marks and attendance of students as a class list.

View 1 Replies View Related

Payroll Database- Advice Needed On Relationships/normalisation

Aug 22, 2006

Hi,
I would like to get your advice on my table setup and relationships for this payroll project. The company is an engineering company with Projects (or construction sites) around the world.

The 'Candidates' are current or potential employees and contractors. There are three main pay categories:

1.Shift-workers
All shift workers doing a particular job on a particular project are paid the same rates e.g. all welders on a particular project or site in England are paid the same as each other. For that reason I want to link the pay rates with the job description for these workers. This avoides creating 50 records for 50 welders on the site in England to say that they make £10 an hour normal time (or whatever it is) etc.

2. Contract
Contract workers usually get paid a flat rate per hour. As these are negociated on an individual basis I would need to have this information linked to each individuals job (M_CandidateJobDetails).

3. Salary
Again this information needs to be input for each individuals job.

For the contract and salary people the pay frequency can vary (weekly, bi-weekly or monthly). So can the currency they are paid in. I haven't got as far as the currency issue yet.

The reason for the one-to-many relationship between M_JobClassifaction and M_CandidateJobDetails is that many candidates can have the same type of job e.g. there can be many employees that in the job classifaction of 'Electrician'. For many of the jobs at managerial level e.g. 'site manager' there will only be one.

I will have a table with the hours worked by each person per week. I can use this for those on shift work or contract to calculate what they will be paid.

One of the main reasons for this database is so that the company can print reports to see what is paid out in payroll for each site and in total (in euros). These will be gross figures and I don't need to take expenses, vacations, bonuses or taxes into account. They other thing we will need to be able to do is assign candidates to vacant positions and change them from one position to another - possibly between different projects.

So basically does anyone have any comments on the relationships, normalisation or anything else. Is this the best way to do it?

I've attached a screenshot of the relationships.

View 13 Replies View Related

Patient Management Database, Help Needed For Tables And Relationships

Jan 16, 2008

Hi,
I am new to this post. I am a physician with interest in database designing. I have been trying to design a database for my clinic for few months but am unable to make one. I have been searching/ reading alot of info and came across this thread. Maybe someone can help me.
Actually, I want to make a database regarding ultrsound scan examinations of patients.
I have five tables.
1. Patients. (patinetid*, patientname, age, sex, address, contact no)
2. Physicians. (physicianid*, physicianname, speciality, address, contact no)
3. Scans. (Scanid*, scanname, charges)
4. Scan orders.(scanorderid*, patientid*, physicianid, scanordernumber, scandiscount, totalcharges)
5. Scanorder details.(scanorderdetailid*, scanorderid, scanid, charges, discount)

I want to have primary key for scanordernumber which wil be the patient number and should this be placed in patient table??
All the ids have been linked with one to many reltionships. Actually I am unable to set proper relationship.
So when the patient arrives he is registered with a unique number, a physian name with date added and scan ordered is entered. Sum calculated. I have done the later part with the form all designed but the relationships and primary key are all messed up.

I can post an image of relationships or blank database.

Kindly advise. Thanks in advance.

View 14 Replies View Related

Tables :: Split Database - Viewing Table Relationships

Sep 17, 2014

My db is split into front-end and back-end. In the f-e's Relationships schematic, I can see the relationships as they were defined at the time when the db was split, complete with the one-to-many symbology.

I can add a new table to the b-e and set its relationship as one-to-many, enforcing referential integrity and cascading as I wish - and the schematic (in the b-e) reflects that.

In the f-e, I can then use the <Get External Data - Access Database> function to link to the new table, and I can add the new table to the relationships diagram in the f-e. I can also drag and drop to link primary and foreign keys (within the f-e), but cannot select one-to-many. I'm OK with that, as I understand that the relationship is within the b-e, and this is just a diagrammatic representation.

But I can see the one-to-many relationships between the tables which existed when the db was split, and I would like to be able to see the new table's relationships in a consistent fashion. Updating the linked tables via the Linked Table Manager does not do the trick.

Surely I don't have to split the database again in order to achieve a consistent diagram - do I ?

View 3 Replies View Related

Tables :: Redesign A Database To Include More Complex Relationships Between 3 Variables

Feb 21, 2015

I need to redesign a database to include more complex relationships between 3 variables non of which are mutually exclusive.These are my 3 tables/fields. Each field is unique in its table.

T_Project.JobNo
T_Accession.AccessionNo
T_Reports.ReportNo

There is no clear relationship between the variables - ie they can all be 1 to 1 or 1 to many or do not have to exist at all. So I realise now (after 14 years of working with this data), that I need to have what I would think of as holding tables between the primary tables that hold combinations of the variables. Do I do this in one table that holds all 3 variables in non-repeating combinations (although this would need to allow nulls) or do I do it in 3 separate holding tables?

View 3 Replies View Related

F Keys

Jul 12, 2006

Is it possible to use F keys to call Forms/Queries. I have used the code below and found when i press F7 spell ceck runs:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF7 Then

Dim stDocName As String

stDocName = "qryDepartment1"
DoCmd.OpenQuery stDocName, acNormal, acEdit

End If
End Sub

I have put this code in the keydown on the form.

Do i need to disable the existing F keys duties.

View 4 Replies View Related

Primary Keys

Nov 28, 2005

I was wondering if anyone would be able to help me? I have two tables which can be linked together as they both contain a field called Company Name. However, in one of the tables I want Company Name to become my primary key but this field contains duplicates. How can Isolve this so that I can still link my two tables together?

View 2 Replies View Related

Link Tbl Keys...which Way To Go?

May 13, 2006

Hi Forum,
I'm building a db to track computer and user problems for work, where I double as a Client Support Administrator (IT Guy).
I have these tables: (simplified list)

tblComputers
tblPeople
tblCompAssignment
tblProblems

I'm at a loss as to how to link the 'Problems' table. This is where I'll record trouble tickets reported by users.
Incoming trouble tickets could relate to the Computer or to the User's Network Login.
I thought I might have a field in the problems table for UserName and also one for ComputerID, but this seems problematic. Anyone got any ideas?

View 12 Replies View Related

Foreign Keys

Aug 25, 2006

Hi,

While designing a database, I came up with 3 different foreign keys in one table. I am afraid this is not right!

Is it possible to have this number of FK in one table or does that suggest a design flaw?

Any help will be very much appreciated.
B

View 7 Replies View Related

Help? Security & Hot Keys

Nov 27, 2007

I am trying to secure my database. I only want people to be able to view the forms that I have created, not the underlying tables, queries, etc. When I open the database, I have it set-up so the menu form opens and the database window with all the tables, queries, etc is not viewed. To view the database window, I use the F11 hotkey. In the start-up menu, I found where to turn these specials hotkeys off, but then as the administrator, if I open the database, how do I open the database window? Every time I open the database now, all I get is my form and I can't get the database window to open?!?

View 2 Replies View Related

Composite Keys

Dec 5, 2005

I have recently started a new project, on one of my tables i have a composite key for my primary key. However when i create a relationship using one of the fields in the primary key i can't "enforce referential integrity". Every time i try i get the message "No unique index found for the referenced field of the primary field"

can any one help

Mindy

View 2 Replies View Related

Primary Keys

Jun 26, 2007

I have two tables :

schema with :

schema-id, Autonumber, primary key
name, text

and a table regel :

regel-id, Autonumber
class a, number (lookup from a table)
class b, number (lookup from a table)
schema-id, Long number

they are linked 1:n. A schema can have many regel's.

I want to make a form of schema and have that form contain a subform with regel's in it. The subform can be shown as a datagrid.

Now here's what I do.. I start the form wizard and select both tables. The wizard takes me to creating what I want and it works too. I have a main form schema and a subform with regel's.

Now I have a problem :

The regel fields (class a and class b) can have only three possible values. And I don't want that the combination of these two fields can be the same.

I'v thought about making these two fields the primary keys of regel, but that doesn't work. It works for one record of schema, but when I navigate to a next record of schema, I can't make all combinations of class a and class b over again. It's like I used the combinations in the preceding record of scheme. Then I tried making three fields the primary key, namely class a and class b and regel-id. Didn't work either. What I need is a primary key on the combination of schema-id, class a and class b. But I don't know how to do that.. after all, schema and regel are seperate tables.

I want to be able to make for every schema record all possible combinations for regel records.

How do I do that?

View 7 Replies View Related

Many To Many And Composite Keys

Oct 6, 2007

Many to Many

I have a basic question, I know for a fact that all many to many relationships have to be broken into two one to many relationships using a junction table. However does that mean it is (a must )to have the two foreign key of the parent tables have to be the (primary composite key) of the junction table.

For example, let’s say I have 5 tables that I need to establish many to many relationships between them. Is it correct to establish a junction table with all 5 foreign keys of the parent tables as composite primary key in the junction table to!

Hope the above making sense!!! :confused:

Many thanks :)

View 3 Replies View Related

Query Using 2 Keys

Feb 28, 2008

I have a database that consists of 7 tables all linked by a school id number. The other tables hold data related to the schools. Another field common to all the related tables is a date field. I could use some direction on how to structure a query that selects data by school and a specific year. The related tables hold data for a number of years and I need to query and report by school for a given year. My main table holds generic school info. The other tables are linked by school_id and have a year field. I have a query that holds all the data - the trick is how to get the data filtered by year. Thanks for getting me started.

View 1 Replies View Related

Saving Keys

Jun 27, 2005

I have a form in which a user uses multiple combo boxes to choose certain items. each item in the combo box has a key attached to it in the table that the form was created from. I would like to save the appropriate key on my form next to the combo box. If this is possible, how do I go about doing this?

Thanks.

View 3 Replies View Related

Using Function Keys

Sep 1, 2004

How can I use function keys to get it to do a constant thing throughout all my forms etc. e.g. to nominate eg "F3" to save data or "F5" to go back a page etc.

View 2 Replies View Related

Composite Keys Possible?

May 13, 2005

Can Access deal with Composite Primary Keys? or will it only let you assign a single attribute key?

If it does allow you to create composite primary keys, how do you go about doing it?

View 1 Replies View Related

Disabled Keys

Dec 17, 2006

Hello,

I have created a log in form in my database and users will enter their name using a combo. Is there a way I can force them to use the mouse and select their name and not type in the data? Basically something that will disables all keys from the keyboard? Thanks.

View 3 Replies View Related

Using Keys From One Table To Another

Mar 21, 2013

I am absolutely new to Access. How do I put the primary key from one table into another table?

View 1 Replies View Related

Changing Primary Keys

May 1, 2005

Hello all,

I am re-working an old database that 'grew up' the wrong way. It is a medical patient database and has 4 main tables. Primary key of main data table is Medical Record number (MR#), a user entered field (I know...). This links to 3 other tables: Diagnoses (indexed by MR# as well, 1-to-1 relationship with main table), Consults (indexed by a compound key of MR# and date, 1 to many relationship), and Procedures (indexed as well by MR# and date; 1 to many as well).

Here is my plan, and I want to know if I'm going to go about it the right way:

I will first delete the relationships between these tables.
I will then give the main table an autonumber field called PatientIndex, and each other table their own autonumber (DiagnosisIndex, ConsultIndex, ProcedureIndex). I will also give each of the other 'daughter' tables a PatientIndex field as well. I will populate the PatientIndex fields of the daughter records with a VBA routine that matches their MR# with the MR# in the main table, and then inserts the corresponding PatientIndex.

Now that each table has no relationships, and has all the right fields, I suspect Access will allow me to change the Keys for each table, and create new relationships, and it should all work cleanly. The goal is to have each table indexed by an autonumber field that is unrelated to user entry, and to link them by the Primary key.

Does this sound like the right approach? As to why do this if it works OK, it's a matter of maintenance. It's simply too buggy as it stands, and it's torturing me. Will my plan work without crashing the db?

View 5 Replies View Related

Two Foreign Keys In One Table.

Apr 20, 2006

I'm not new to access, and I understand normalization at pretty much all its levels, but right now I'm curious about a situation that I have just come across. The first time I've been in something like this, so I thought I would ask.

This is the setup.

I have employees. They are apart of a shift and a budget. Shifts and budgets are completely independent of each other.

The database needs to keep track of shifts and budgets over time. Therefore, 1 to many relationship to shift table and budget table.

But, the database also needs to keep track of attendance. And the user wants attendance tracked by Shift and Budget.

Shift and budget are completely independent of each other.

Currently, I have the relationships set up like this.

Employee (1) ---(Many) Budget (1)------(Many) Attendance
Employee (1) ---(Many) Shift (1)--------(Many) Attendance

When a new attendance record needs to be added, both the key to the budget and shift are added to the attendance table. The key chosen is dependant onthe Employee chosen, and whether the budget and shift are the CURRENT budget and shift that the employee is apart of.

I thought of running a query showing budget and shift by date descending, so that the latest budget / shift would be displayed, and thus the most current (SUPPOSEDLY) But, if a user put in a different date, or screwed up on the date, then the incorrect shift and/or budget would be displayed.

Date stamping an entry was an option, but there needed to also be a user entered date as well, to specify WHEN a user began working in that specific budget / shift. Therefore two date entries would be required. Duplicate entries in most cases.

I therefore decided to go with a true/false yes/no checkbox. Where the current budget or shift would be checked, and all non current ones would be unchecked (false).

Currently, this is how the systems works. And it works well. But it is dependent on some form code I created to set the yes/no checkbox to true/false depending on the situation.

I DON"T like doing this. Am I missing a way to do this "correctly" where by Access would do this "automagically" instead of via my trick.

The ONLY issue really, is that when a new attendance incident occurs, the user needs to put in the incident to the approbriate shift / budget. And if the current shift / budget could automatically be displayed without user intervention (IE user has to pick the shift / budget from drop down box after looking up info etc etc) since the current information SHOULD be known.

I've never done a table setup where two foreign keys are the many side of the relationship in a single table.

It is currently working fine, and seems to do well, but I wanted to make sure with others who might have had this experience. And also, any "advice" / "cautions" for this kind of situation so I don't step into it deep and have to fix it later.

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved