Relational Modelling Confusion !!??

Mar 9, 2005

Im trying to figure out how to model 'Printer' and 'Cartridge' information. The relationship between them is Many to Many, but to add to my confusion, more than one cartridge can be used in a printer (Black + different colour cartridges). Adding a new entity to resolve the Many to Many does not solve this issue of how a printer can have, for example, a black cartridge and 3 different coloured cartridges.

Any ideas how to model this please?? I have been toiling with it for some time and I keep going round in circles :confused:

I'm sure it shouldn't be as difficult as it seems, so I'm hopeful someone might be able to set me straight :o

View Replies


ADVERTISEMENT

N00b To ER Modelling, Please Help!

Dec 8, 2005

Okay, can anyone help me with the following:-

I have to create a database on theatre booking system. So far, ive identified the following entities:

Customer(Customer ID, Title, Initials, Surname) Customer ID is PK
Bookings(-------)
Play(Playname, Playwright, Number Of Characters, Length(min)) Playname is PK
Actors(-------)

i do not know what to create as attributes for the bookings table, especially seeing as the attributes have to relate to customer and play. for the actors table i was thinking of putting in the following attributes:-

Actor ID, Name, Age, Playname, Role (Actor ID is PK)

but i was unsure if they worked, although i think they would, because playname from the play table would be a foreign key in the actors table. this is where i come into conflict with the bookings table, ie what could add to teh custoemr table as a primary key that would make a suitable foreign key in the bookings table, and what could be a suitable primary key in teh bookings table, and also a suitable foreign key in the play table? please help, its an urgent issue. thanks very much for your time.

Fergal

View 2 Replies View Related

Database Modelling!

Oct 6, 2005

I wondered if you might be able to help me with a database problem I have. I'm doing this in access so I've attached a copy of the relationships window.

This database is suppose to store stock levels and orders for a chain of stores that all stock the same products. So I've got a product table, a company table with all the different stores and a linking table called stock.

So far i think my design works fine for this. My problem is that some products can come in various colours and others dont. With the current design you'd have enter different colours as unique products in the product table when in fact their only different attribute is colour. This seems a bit redundant and I feel i should have another table with colours in it linking to the product id in the product table.

My problem then is I not sure how to link the product table to the stock table when there is no option of colour and a colour table to the stock table when their is multiple colours.

Basically I need to be able to query the db to show stock levels for individual colours alongside products that dont have various colours. However, I also need to be able query for overall stock of a particular product (ignoring colours) alogin side products without any colours.

Cheers for any help you can offer!

Luke

View 2 Replies View Related

Syntax Confusion

Aug 28, 2005

Greetings all,

I am trying to run the query below to tell me how much stock a company has available by deducting the amount dispatched from its allocation. I am getting an error message;

Run Time error '3061'
Too few parameters expect 2

The code is;

Dim db As DAO.Database, qr1 As DAO.QueryDefs
Dim rs1 As DAO.Recordset, rs2 As DAO.Recordset
Dim varVal0 As Variant, varVal1 As Variant, varVal2 As Variant
Dim strSQL As String
Set db = DBEngine(0)(0)

VarVal0 = Me.WINENUMBER

strSQL = "SELECT Sum(tbl_Data_DispatchLineitems.Amount) AS Amount "
strSQL = strSQL & "FROM tbl_data_DispatchDetails INNER JOIN tbl_Data_DispatchLineitems ON tbl_data_DispatchDetails.DispatchID = tbl_Data_DispatchLineitems.DispatchID "
strSQL = strSQL & "GROUP BY tbl_data_DispatchDetails.TradingName, tbl_Data_DispatchLineitems.WineNumber "
strSQL = strSQL & "HAVING ((tbl_data_DispatchDetails.TradingName)=[Forms]![frm_data_Orders]![TradingName]) AND (tbl_Data_DispatchLineitems.WineNumber = VarVal0)"

Set rs2 = db.OpenRecordset(strSQL)
rs2.Edit
varVal1 = rs2![Amount]
rs2.Close


I assume the error lies in the final line of the query code. Any help to find the error would be appreciated.

Thanks in advance.

~rbinder

View 1 Replies View Related

Query Confusion

Oct 27, 2005

I am having a problem creating a query on a MS Access database and would appreciate any help.

I have 4 tables:

Table1 – Name_ID, Name, and Address
Table2 – Donor1_ID, Name_ID, Donor1_Item, Donor1_Item_Description
Table3 – Donor2_ID, Name_ID, Donor2_Item, Donor2_Item_Description
Table4 – Donor3_ID, Name_ID, Donor3_Item, Donor3_Item_Description

The Name_ID in each Donor Table points back to the Name_ID in Table1.

What I want to do is get a list of the Name, Address, Item and Item_Description for any record found on either Table2, Table3 and Table4 and then sort the result set by Name.

My tables are all very small – 100 entries at most on any 1 table.

My queries so far are returning 40,000 and 50,000 records – I assume because I am writing SQL that forces sub-queries.

I am more familiar with SQL using Where Tbl2_Name_ID equals Tbl1_Name_ID or Tbl3_Name_ID equals Tbl1_Name_ID or etc rather than inner joins or left joins so I am struggling.

I know this has to be elementary, but I am missing it.

Thanks for your help

View 2 Replies View Related

Problem, Sql Confusion?!?

Nov 12, 2006

I'm trying to show an overview of the green and red cars which were bought in june or before, ordered on price, I have this:

SELECT car.carname, car.colour, car.Bdate, car.price
FROM car
WHERE (((car.colour)='red') AND ((car.Bdate)<6)) OR (((car.colour)='purple'))
ORDER BY car.price;

It works all except for the <6 part (doesn't work with =<6 etc either). The month is only used in this column and represented by a number i.e. 6.

I hope this is clear and I hope somebody can help me with my problem!

Thanks in advance.

View 2 Replies View Related

ListBox Confusion...

Jun 24, 2005

Okay,

I have a listbox that populates it's values from a table. Upon the click() event, I run a script to determine the current record for the rest of the form. One of which is an TextBox bound a field in the table the ListBox is populated from.

I store the old values in the Form_Current() method, and allow the user to change the values in the TextBox, and upon textbox_change() I enable an 'Apply' command button.

When the Apply Button is pushed, I set the "saved" data to the actual current data (since the control is bound to a record field), and thus the changes are fully applied. However, I cannot seem to get the ListBox to update it's 'text' display to represent the changed value from the textbox.
I have tried ListBox.requery, but it doesn't work instantly...it sometimes is delayed until I change "apply" a new set of changes.

Why is this?

Specifics:
Table
AreaID (AutoNumber)
Area (Text)

Query
Table.*

AreaList.RowSource = Table
AreaEdit.ControlSource = Area


Private Sub AreaEdit_Change()
Dim St As String
St = AreaEdit.Text
Debug.Print "Chg Text: " & St
Call UpdateChanges(True)
End Sub

Private Sub UpdateChanges(ByVal Value As Boolean)
ChangesMade = Value
ApplyBtn.Enabled = ChangesMade
End Sub

Private Sub ApplyBtn_Click()
AreaList.SetFocus 'this is because you can't disable a control (the applybtn) when it has the focus
AreaList.Requery '<==== THis is supposed to repopulate the listbox, but it doesn't do it.
Call Form_Current 'this just stores the current values of the actual record into temp variables
Call UpdateChanges(False)
End Sub


Thanks

Jaeden "Sifo Dyas" al'Raec Ruiner

View 3 Replies View Related

Check Box Confusion !!

Mar 7, 2005

hi ..had a quick search through the pages, no luck.

i have 8 check boxes on my Search form. If i check one of them...i want to send certain text to a field. is this possible? eg: i have 8 check boxes with different project names, if i check my check box named "Laem Supot" i want the the text "Laem Supot" to be sent to my Project Field on my listbox.


i found a similar for a date value:

Me.yourcontrolname.Value = date() .....(would this work and how do i implement it)

however i may need to check 2 or more check boxes, therefore i can't send 2 project names to one field.
My clients may be associated with 2 or more projects, how do i show this or represent this in my SEARCH FORM.

any solution??

View 3 Replies View Related

Relational Database - Is It Possible?

Feb 18, 2008

Hi folks, I'm new here - pretty hot at Excel but a total newbie at Access, So..

OK, I've got my database up and running. It keeps records of about 500 staff - everything is working fine but I now want to do stuff beyond my capabilities.. I've got a master record (Master Staff List) and a main input form (Data entry/amandment form). One of the input controls (via a sub-form) is for recording the time staff have spent working at a higher grade. Now if this was a one-off occurrence I could handle it but any one person could have multiple occasions that need recorded and I don't want to 'overwrite' the previous record. I have tried researching the problem and I think I need a 'one-to-many' relational table and a way to add a new period from the subform when required. The subform would also need to show blank when I opened it.

Any help would be appreciated.

View 5 Replies View Related

Relational Database Help

Jan 19, 2008

Hi guys, I'm fairly new to databases and am just creating sample ones at the moment and following tutorials from books. I tried to create my own cinema/movie database yesterday and there's something wrong.

I really wanted to work this one out for myself but after trying many different combinations of various relationships I just can't seem to get it working.

I have four tables..

A member table: MemberID
A booking table: MovieID, Screening Number, MemberID
A movie table: MovieID
A screening table: Screening Number


So the booking table is a composite key that links the member tbale (via the memberid), the movie table (via the movieID) and the screening table (via the screening number)

The problem occurs when I try to make a booking form for members to book a movie.

I use the form wizard and take the following fields:

The MemberID from the member table, the Screening Number and MovieID from the booking table. Then I add other relevent information from the Movie and screening table (for example, screening time, date, price etc from the screenig table and movie name, information from the the Movie table)

The MemberID is displayed on the main form with the other information in a sub form.

The problem I am having is when I enter a booking on the form, I get an error telling me the Microsoft Jet Engine cannot find the screening number in the screening table or something like that.

It lets me enter the other information but not with the screening number.

Thanks for any help.

Benn.

View 2 Replies View Related

Coding Causing Confusion - To Me

Apr 20, 2006

Yesterday I posted a question and rec'd good advice but as usual I don't think I explained myself very well.
As the attached picture of my Form shows, I have a checkbox for each Age Group under each Team. I originally had a query that would come up for each Team's particular Age Group and then the required data copuld be input. This leads to too many querys clogging things up. I tried to copy the SQL code of one of the query's to the On_Click event of the checkbox but as I have been informed SQL is different to VB.
All I would like to know is how to convert the SQL to VB coding so that I can continue to do the coding for each Checkbox.
The SQL code for the first checkbox is:

SELECT tblPlayerRegister.Surname, tblPlayerRegister.[First Name], tblPlayerRegister.Age, tblPlayerRegister.[D'n], tblPlayerRegister.G1, tblPlayerRegister.SP, tblPlayerRegister.Age2, tblPlayerRegister.G1A
FROM tblPlayerRegister
WHERE (((tblPlayerRegister.Age)<11) AND ((tblPlayerRegister.Club)="Beaconsfield"))
ORDER BY tblPlayerRegister.Surname, tblPlayerRegister.[First Name];

If there is an easier way, by all means let me know.
Any assistance would be greatfully appreciated.

View 1 Replies View Related

Lookup Table Confusion

Nov 21, 2007

Hi everybody

I have been unsure about this topic and want to finally be sure.

When I create a lookup table I don't include a PK; I just have the one field. Therefore I don't include an FK within the Main table; I include the same field name as the field name in the lookup. "sector Details" in lookup and "sector Details" in Main.

Am I better to make up these lookup tables and use a PK and then have the FK within the Main Table? Is this easier or trickier to work with? And will it cause any problems if I did include keys? for example, providing combo boxes as search criteira for forms using the FK/PK as bound fields?

I know it's a bad idea to have lookup fields in tables which I'll avoid. But this means if I'm updating in the back end I'll only see a table full of keys and not the field name!

Hope someone can help because I've been getting different advice since I started on Access including Professional books using lookup fields.

Thanks.

View 8 Replies View Related

Append Dates - US/UK Confusion!

Feb 27, 2006

Hello All,

Hoping you can ride to my rescue...again! :o

I have a series of append queries that run when a database opens, to copy over the contents of various log files into a single table.

Each record has a field, [1-DateTime], which (surprisingly!) contains a date/time. When I open the linked text files from Access, these appear absolutely fine, all in US format (mm/dd/yyyy hh:nn:ss). But when I run the append query, it gets all confused, and puts them into my table in a conbination of formats!

Those that it can recognise as UK dates (e.g. 01/05/06) it stores as 1st May 2006, but then it gets to 01/22/06 and it decides that they must be US dates, so stores them (CORRECTLY) as 22nd January 2006.

Hope I have explained myself sufficiantly!

View 1 Replies View Related

Nested Query Confusion

Sep 23, 2007

Dear Access Expert

I have been doing some experimentation with Queries and I have discovered something unusual.

If I have one query and I use the totals feature (only using group by) I get all the records based on the inputed criteria

If I then use that same query as an underlying recordset for a second query and I use the totals feature (only using group by) in the second query... I only get the first record of each type. See query results below..

I am trying to achieve the results of the second query in the first query (DON'T WANT NESTED Queries) and I don't really understand why the results of the queries are different when everything else is the same other than one being nested.


Example below

First Query Results (using totals with group by)

1 a
1 a
1 a
2 a
2 a
2 a
3 a
3 a
3 a
4 a
4 a
5 a

Second Query Results with the First query as its recordset (using Group By)

1 a
2 a
3 a
4 a
5 a

View 3 Replies View Related

Tavular SubForm Confusion

Dec 9, 2005

I do have questions about tabular subforms. I have created several forms and I thought that they were linked together. The main form (GSI) is general information about each site that we visit. The tabbed forms are about various survey's done on a site. So, what I thought would happen is; I'd fill out the info on the GSI forms about each site. I'd go back after doing a survey, look up that site, click on the corresponding survey tab and add information about that survey and It would link back to the site on the GSI. What is happening is, when I pull up a site and add survey data the same survey data comes up in the next site also. I think, the problem is,

I have a switchboard with Add new site and Edit site. When I go into Edit site and I do a search by Site name, it pulls up the name, but not the record, so I'm just changing the site name by doing it that way. If I move down to the bottom of the form and scroll or move through the records that way it works right, but I need it to be more user friendly. I'm sure that there is a statement I could create to do this, but I'm not knowledgeable enough to know what it is. :confused:

View 3 Replies View Related

Relational Data Problem

Feb 16, 2008

Hi

Not sure if anyone can help. Its been about 10years since I've built a relational access database, but offered to build one for someone, but am now a little stuck.

Its a photo sales tracking db.

I have 3 main tables. Photos, Sales & Customers.

The main form is a photo form with embedded subform showing the list of the sales related to the photo. This works well!

The second form is a customer form with embedded subform showing the list of purchases (sales form) related to that customer. This again works, but I cant get it to show the photo title of that sale in that subform. I think I am missing some sort of link.

I have relationships between photos and sales, and customer and sales. But it always shows a blank photo title field in the customer purchases list

This is a very brief outline and I can explain in more detail if some thinks they can help. So far the database looks good and mostly works but it is all a bit relevant if I cant get the customer purchases to automatically show the name of the photo sold.

Any help most appreciated!

View 4 Replies View Related

Update Relational Databse

Mar 7, 2008

Hello everyone! I am completely new to MS ACCESS, so this problem might be fairly simple but yet it is eating my head.So if I get some directions it will be greatly helpful and appreciated.
Description:
The bakery buys ingredients from number of suppliers, makes a several kinds of cakes and sells to few shops. There are about seven ingredients in the first week with the possibility to add new in ingredients later on. There’s a catch though; on any day, only a single type of cake is made, in a single batch and all of them must be delivered before the next day’s cake are finished. It is necessary to be able to rack the ingredients used in a batch back to the suppliers.
I have made tables for suppliers, ingredients, orders and order line (with fields ordereId, ingredientId, quantity, unit price).
Forms that allowing users to allow new ingredients types, suppliers, and new order for ingredient are required which I have made. These forms are to be used to add the data for which ingredients are needed in the second week of baking.
So these are my questions on which I am stuck in

1. Do I need any more Forms or do I need to edit my form?
2. Is it okey to put table as the data source or would it be better to place a query?
3. How do I keep records of my earnings and expenditure, expenditure and keep them updated with my databases?
I hope you will understand that I am completely new to these topics and its really hard for me to grasp them all at once. Merely some guiding points will be of great help. Thank you.
6pandn21

View 2 Replies View Related

Split One Table Into 2 (relational) Ones

Feb 5, 2008

Hi there!

I'm currently working on a malformed Access database, not normalized at all.

It only consists of one table and is designed like this:

(table compartment)

#ID#Name#Member1#Member2#Member3#Member4#...#Membe r20#

So all the members are realized by single columns.
I created a new database, consisting of the main table, the "people" table and a relation table, connecting the people with the compartment (n:m relation).

It works great but I have to get the old data into the new tables. The old main table consists of more then 100 columns, and most of them are now hived off by using relations.

Now I'm looking for a smart solution to convert the table.

Do you have any idea? I tried to use a Query, but I couldn't merge two or more columns and put them in a single one on a new table.

Thank you in advance!

View 13 Replies View Related

Text Box In Relational Database

Mar 15, 2005

Hi all, i have a relational database. In a form, Transactions, i have a text box, CustomerID, which relates to the primary key of the customers table. At the moment, if i enter a number that has no related record in the customers table, it will alert me only when i try to close the form or move to another record. I am wondering if it is possible to check for a related record immediately after the text box loses the focus.

thanks
joe

View 2 Replies View Related

Relational Database Principles

Jan 22, 2008

The first time a person tries to use Microsoft Access, they are likely to miss the whole point of what a database is and how to use it. When they start having trouble making it work for them, they think in terms of what they may be doing wrong in their use of the obvious tools of Access. But often their problem is that they are unfamiliar with the principles that make databases so useful and they have started with a flawed database schema.

This tutorial is intended to explain the underlying principles of relational databases. It is, admittedly, rather theoretical and perhaps even boring. But without an understanding of these principles, a beginner cannot hope to use Access for any really useful purpose. If you are a beginner, I urge you to read through the entire tutorial.

There are several issues that arise time and time again, such as:

. Storing multiple values in a field.
. Storing calculated values in a table.
. Determining primary keys.
. Using Autonumbers.
. How many tables does this database need?
. Why don't my queries work?

Sometimes answers in the forum make it sound like these things are a matter of preference, or "which is the best?" But in most cases, they are not--there are well established rules that determine the one correct answer. It is only with an understanding of the principles of relational database theory that you can determine the answers.

So I hope you will find it worth your time to study this 7-page tutorial. If you think you've found something in it that's incorrect, incomplete or impossible to understand, please feel free to contact me. I have been known to make mistakes!

View 5 Replies View Related

Corruption Confusion- Any Ideas Are Appreciated

Mar 24, 2006

I'm running Access 2000 through Citrix, 20 users internationally from 1 db. I'm working through Citrix network issues to split db with separate FE's for each user.
I have sporadic corruption due to this. But this morning I met a new breed of corruption. I preface this with the fact that I run a bat file nightly to do clean up and compact and repair the db. It verifies the db is not in use prior to running.
This morning we were presented with a hosed db.
The log file said updates ran fine.
In my main table the first record was garbage, including the Auto-num field. I found that my Primary key has lost it's index and references had become unchecked.
Correcting these issues got it running but does anyone have any clue what might have triggered this or even where I should start looking? Please help as I am at a loss.
Thanks.

View 2 Replies View Related

Access Record Locking Confusion

Oct 6, 2006

In OPTIONS -> Advanced I have the option Open Database using Record-Level locking ticked.

What is strange is record level locking works on Form1 (Form1.recordlocks= Edited) as long as Form2 has Form2.recordlocks = No Locks. If I change the Form2.recordlocks = Edited, Form1's locking becomes page level locking.

This is even true if Form2 is not open...

Additionally, Form2's locking is always page level locking if Form2.recordlock = edited.

I would like all my forms to perform RECORD level locking not page Level locking. How do I accomplish this.

I've been trying to resolve this issue for about 2 months now but no answers from the community.

Thanks for any comments.

View 8 Replies View Related

Form For Comic Book Confusion

Apr 6, 2005

hello, this is frazzling my brain i cannot comprhend the answer :confused:
sorry werent sure were 2 post this hope this is the right place

I have an array of comics 300 they come out weekly, the first is Number: 344 this came out 26th September 1983, i have a form with a combo box were i select the comic number (344 - 700+) in this case i am selecting 344 and i press a button "command 11", i would like it to display in three text fields, date, month and year. This has well an truly killed off my brain. Any help would dearly be appreciated.
Need any further information just ask.
Paul

View 6 Replies View Related

Unique Results Of Two Relational Query's

May 14, 2007

Hi, I have a query with approximately 100 criteria. That is a bit much, thus I have made a table of the criteria and in the query a relation laid to this table. The criteria are countries with an increased risk on tbc. I point these query on a column with parent 1 and afterwards on the column with parent 2. Then I want the results from both query's in a table, but without double rows. I have tried this with a merge query but these only give the results where the hits for parent 1 and parent 2 are the same. This is by far not always the case, so, I miss all hits where there would be a hit for one parent only. Cumbersome tale, but perhaps there is someone who understands what I mean?

View 4 Replies View Related

Date/time Period Criteria Confusion

Jan 30, 2008

Hi there

I have created a database in Access XP (2002). In a nutshell, the database records numbers of people attending a seminar; which can take place any number of times per week, and so hence can take place any number of times per month.

I have set up the query so that it can run immediately after a seminar to show the attendants who attended the seminar on that current date "Date()" in the criteria box. However, how would I go about setting it up so that it shows who attended every seminar in the current week or month?

View 1 Replies View Related

Data Access Pages Using A Relational Database

Aug 11, 2005

Im creating a data access page overtop of a relational database. the database is simple... it has customers and workorders. there may be more than one workorder for a customer.

When I create a new customer record through my data access page, I want it to automaticly create a new workorder (filled with 0's)

Does anyone know how to do that?

Thanks
--Ben

PS: I understand SQL... I just need to know where to enter it (if necessary)

View 1 Replies View Related







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