Relations Driving Me Crazy
Mar 3, 2007
Hi,
I'm trying to build a mdb which holds customer details, which insurance they have, who sold them this and which Insurance company provided this.
The relations I have to make are driving me nuts !
When I try to enter a new customer in a Form, there is a advisor added, the package the customer wants is added. But this shouldn't happen for the advisor and the package allready exists !
Who can help me with the proper relations ?
Attached is screendump of the current relations.
Thanks a lot !
View Replies
ADVERTISEMENT
Oct 18, 2006
Hehe... and since me and my girlfriend just broke up, that seems applicaple both in the dbase and the real world ;)
I have one Access Database. For now containing three Tables:
KlantNAW (customer adress data) with one primary key, Klantnummer (clientnumber) which is an Autonumber Data Type, Long Int, Increment, Indexed: Yes (No dupes).
CaseDateTimeInfoTable with one primary key, Casenumber which is an Autonumber type, Long Int, Incremental, Indexed: Yes (No dupes).
Within this table I have included the Klantnummer field from KlantNAW as a Number, Indexed: Yes (dupes OK).
CaseTechInfoTable with no primary keys but with both the KlantNummer field and the CaseNumber field included. Both have a direct relationship to the tables in which those two values are created. Both values are now of type Number, both are Indexed, but Klantnummer is set to Duplicates OK and Casenumber is set to No Duplicates. I don't know if it might be wiser to just not index those values in this table, since they are already indexed in the tables in which they are created, if someone could tell me which is better in this case, please do.
I have created a one-to-many relationship (well actually, access seems to decide whether it becomes a one-to-many or one-to-one relationship) between KlantNAW.Klantnummer and CaseDateTimeInfoTable.Klantnummer with Join Type 1 and I've created a Join Type 1, one-to-many relationship between KlantNAW.Klantnummer and CaseTechInfoTable.Klantnummer.
There is only one extra relationship left, which is a one-to-one, Join Type 1 CaseDateTimeInfoTable.CaseNumber with CaseTechInfoTable.CaseNumber.
So ehrm.... a recap:
KlantNAW.Klantnummer (P-key) with CaseDateTimeInfoTable.Klantnummer
KlantNAW.Klantnummer (P-key) with CaseTechInfoTable.Klantnummer
CaseDateTimeInfoTable.CaseNumber (P-key) with CaseTechInfoTable.Casenumber
If I leave it like that the dbase works perfectly except for the fact that when I delete a customer the related case date/time info and the case tech info don't delete with the client account accordingly.
So, I thought I'd "Enforce Referential Integrity" and "Cascade Delete Related Records". I do not know if it would be wise to also enable "Cascade Update Related Fields". Could someone please tell me if that would be wise to do or not? And maybe even why... I have some beginner and more advanced books but can't be sure, probably because of lack of experience (or maybe lack of brains ;) ).
Anyway, back to the problem: when I make all the relationships to Enforce Rererential Integrity and I add a customer through a form (KlantNAW_InvoerForm) and click the "Create new case for this customer" button, the form I use for entering the case date info pops up nicely, but when I try to close that form I get an Error stating: "You cannot add or change a record because a related record is required in table "KlantNAW"". So, I click ok, then get a messagebox stating I can't save the record at this time. Do I want to close anyway? .... well, ok. Let's do that. And now the strange thing is that after that, when I do absolutely nothing other than pressing the create new case button again, enter the date/time info into the form and close it again, no errors or messages come up. Wel... that should happen the first time around right? What's wrong?
Now... I'm really lost. I'm new at this. I made some tables, queries and forms, set all options for all values, that which I didn't understand mostly tried solving or finding out on my own but now I'm hitting a brick wall.
If you guys and gals could help me out I would really be very grateful for that.
EDIT: I even tried making it more simple by removing all relationships and creating just one new one between KlantNAW.KlantNummer and CaseDateTimeInfoTable.Klantnummer (type 1, enforce referential integrity and cascade deleted records) but still, the same problem arises.
EDIT2: made sure it was not a form thing by just putting in data in the table data views directly. Same thing occurs.
View 14 Replies
View Related
Nov 13, 2007
I just started learning Access and I have created a database with 53 records, 3 tables and 1 Split form. I creared a new yes/no field and I am attempting to display "Completed" in green for yes and "Not Completed" in red for no. I used the correct code in the format field:
"Not Completed "[Red];" Completed "[Green]
This worked for different field before I created the split form but now I cannot get the new field to display anything but check boxes regardless of what code I use. It won't even let me use the default yes/no, true/false or on/off options.
I've been studying this for about 2 weeks and I've figured out quite a bit but this one thing is really iritating me....:eek:
Help
Any comments would be appreciated
John
View 3 Replies
View Related
Jul 19, 2005
I am trying to create a chart on a Form. In Excel I have no problems arranging my data. This is my first try for charts in Access. I have a table. I created a query summing two fields of this table:
Total Workers
Total Workers: DCount("[WorkerNameLast]","1-StationVerifyTbl","[ClockNbr]<>'*'")
Total Workers = 120
Total Verified
Verified Workers: DCount("[WorkerNameLast]","1-StationVerifyTbl","[StaPrimary]=True")
Total Verified = 43
So far so good. That is the correct information. What I want in a Chart is two bars side by side. One bar at 120 and the other bar at 43. I have tried everything and cannot get this to work. I am getting confused on the Axis, Data, & Series. I think I need another Field somehow. The totals I would call Monthly Totals
Could someone please help me get this thing started. I have wasted a week and feel like I have learned nothing except how to count in the Query.
After this I would like to be able to show a percentage of those verified. I have 120 workers and 43 are verified. That would be approx 35%. Anyway I am assuming that there is a solution and that I am just floundering for nothing. Thanks in advance.
View 8 Replies
View Related
May 27, 2006
I have a subform with textboxes for data entry.
I want the last data entered to stay displayed in the textboxes after the form is closed.
When the form is re-opened the textboxes display a row af data several rows down.
How do you link the textboxes to the feilds of the subform the new data is always at the top row.
Example:
Form textboxes data Entry:
Apples Oranges Pears grapes
Click command button to save:
Subform displays
Apples Oranges Pears grapes
Grapes Kiwi Tangerines Corn
Beans Lettuce Okra Rice
Close form Text boxes still display Apples Oranges Pears Grapes
Open form back up
Text Boxes Display
Grapes Kiwi Tangerines Corn
Subform Displays:
Apples Oranges Pears grapes
Grapes Kiwi Tangerines Corn
Beans Lettuce Okra Rice
How Can I make this work Right?
If anyone knows how to do this please Help.
If it must be done in code please provide an example.
I need to get this worked out this weekend.
Thanks for all the help
You guys are great!:D
Charles
View 4 Replies
View Related
Jun 14, 2006
Hello!
Hope someone can help. My code behind my command button is not working. It is opening Report1 but not the criteria in the query.
I have a form (form1) with 2 unbound text boxes on, called "txtDatefrm" and "txtDateto" in which dates can be entered. There is also a command button on the form which searches for these dates and then opens a report(Report1). The report's control source is a query. (query1). On the ExpiryDate field in the query I have the criteria:
Between ([forms]![form1]![txtDateFrm]) and ([forms]![form1]![txtDateTo])
Behind the command button I have the code:
Dim stdocname as string
Dim ExpiryDate as Date
txtDateFrm.setfocus
ExpiryDate = txtDateFrm.text
If Trim(ExpiryDate) <>"" Then
stdocname = "Report1"
Docmd.Openreport stdocname,acViewPreview
End if
Many Thanks for any suggestions!:eek:
View 4 Replies
View Related
Sep 11, 2003
Run-time error '438'. Object doesn't support this property or method
The command:
If Not IsNull(DLookup("[JSANo]", "JSA", "[JSANo] = '" & Me.JSANo & "'")) Then
I think the rest of the code is uncessary. I have searched Google over and over. From what I can gather this error can mean more than one thing.
I have moved the data into another new exact same field, deleted the old field, renamed the new field to have the old field name. Still keep getting this message. At one time, I had messed with the index settings on the field. Thought I saw something about that can cause problems.
I have this exact same command on another field name and it works perfectly, but on this one I get the above error. Ideas?
View 1 Replies
View Related
Oct 21, 2005
Hi,
I've split a database and the backend relationships are still intact but the front end they are not and it looks like this is causing a problem. Is this usual?
View 5 Replies
View Related
Aug 30, 2007
How do I make the reports show in relations?
I'm (as said before) totally new to everything that has to do with programming, and therefore I work in the visual way, and thus I need to have the reports shown in relations in order to work with it...
Any ideas?
View 1 Replies
View Related
Jan 12, 2008
After designing the database that mean after creating all the tables and when pressed on relations buttuon it shows a diagram with relations established. Is this a kind of ERD. in this it shows relations between entities so can we call that an ERD?
View 3 Replies
View Related
Nov 24, 2004
Hi there,
I'm a bit stuck on this but it should be pretty easy.
Say I have a table secondHandCar - this contains infromation on the makeID (eg 123), price, number of doors. Now each car can have a number of images, this number isn't set so I have an images table...
tbl_secondHandCar
makeID - key
price
number of doors
tbl_images
makeID - key
Image (ole, binary whatever)
Now clearly I have a problem: the images table is going to have many makeIDs with different images. I've just got stuck here - do I need an image id or something? But then my make ID will still repeat in tbl_images.
Thanks for the help :rolleyes:
View 1 Replies
View Related
Aug 8, 2007
I have a DB and for some reason queries aren't working properly. My guess is the table relationships I made. If anyone else has an idea on changing my relationships so that all forms and queries will work to thier full potential please give my DB a look.
Any Help will be greatly Appreciated
18338
View 2 Replies
View Related
Apr 19, 2005
Hi,
I am creating some table for a database I want to use.
I had the following tables:
[Organisation]
orgOrganisationID (primary key)
orgName
orgPostalcode
orgStreet
orgCity
orgCountry
[Contacts]
coContactID (primary key)
coSurename
coFirstname
coFysicPostalcode
coFysicStreet
coFysicAdditions
coPostPostalcode
coPostStreet
coPostAdditions
coTel
coFax
coEmail
[Postalcodes]
poPostalcode (primary key)
poPostalCity
poPostalCountry
I have two postalcodes in the Contacts table. I can't create two one-on-many relations from the Postalcodecodes table to the Contacts table.
So I thougt I split up the contacts table and create a one-on-one relationship between the two new tables.
So it would look like this:
ContactsGeneral
cgGeneralContactID (primary key, autonumbering)
cgSurename
cgFirstname
cgFysicPostalcode
cgFysicStreet
cgFysicAdditions
cgTel
cgFax
cgEmail
ContactsPost
cpPostContactsID (primary key, numeric)
cpPostPostalcode
cpPostStreet
cpPostAdditions
I would create a one-on-one relationship between coGeneralContactID and coPostContactsID. And now I can create my one-on-many relationships between from the Postalcodes table.
1) Is this clever?
2) Should both these fields have a key?
3) I set coGeneralContactID to autonumbering and coPostContactsID to numeric. is this also correct.
4) I also use prefixes before the fieldnames 'cp-' for 'ContactsPost' is this naming convention ok? I think it makes programming easier. But are there condingstandards for that in Access/VBA?
Thanks,
Jayke
View 2 Replies
View Related
Nov 1, 2005
Access user,
:confused:
I am looking how to generate a relation in one database between records of the same field type.
f.i. you have a database where you try to keep track of your parts.
You order a part1 but they deliver an identical part but from another brand so it has another part number.
You will store it under his correct partnumber being part2.
Due to the fact you still have stock of part1 and just recieved part2, now you will run out of stock when part1 + part2 reach zero stock.
In order to be able to monitor this you must be able to generate a relation between part1 and part2 showing that that parts are fully interchangeble.
How can you realise this in access?? Or is this impossible?
Also would it be possible to have for a certain part number multiple relations?
f.i. parts are fully interchangeble
restricted interchangeable
one way interchangeable
Thanks in advance
View 1 Replies
View Related
Aug 9, 2007
Hi all,
I built a database and I was wondering if anyone has any suggestions on how to normalize my DB. I think my table relations are wrong.
I'll post my DB for you people to view.
18354
Any Help will be appreciated
View 5 Replies
View Related
Sep 14, 2004
Can anyone shed light on why my Database seems to have stopped working so far as I've a combo box on a main form, which provides one half of a PK/FK relationship. The subform displays one or more records for this value. However, I've just entered the same 'value' (string) for an entry in the combo box as another, which shouldn't display any records in the subform yet - but it displays the records of the first combo 'entry'. This important thing is that the key's are all unique (I've doubled checked this), so why does it seem to not work?
Please.
View 1 Replies
View Related
Aug 16, 2006
I have 3 tables Metrics, FixedExpenses, Variable Expenses, I want them all to have a date in a form, and a subform for all the records to be added. I want to be able to do this without having 3 seperate date tables linked to the other three tables. I am not sure how to do this correctly. (I want to be able to see all the records for a certain day in these forms.)
View 1 Replies
View Related
Mar 18, 2005
Can someone please help me because this is driving me insane!!
All I want to do is open a form which automatically copies the ExampleID from another form which is open.
For example on an Orders Form there will be an OrderID (Primary Key) so when I click to open the OrderItems form, which will open so that I can add an item to the Order, I need the same OrderID (Foreign Key) to automatically match the OrderID from the Orders form.
I've tried making the default value for the OrderID (Foreign Key) = the OrderID on the Orders form but the database doesn't like this method and produces errors!
Does that make sense? I hope so as I am in need of a very kind persons help!!!
Thanks,
Paul.
View 5 Replies
View Related
Apr 7, 2015
I have a table named [Brand] and several tables named [Brand@@@Models], one for each field in the Brand table.I want each field from the [Brand] table to be related to it's specific Model table. I thought like that so I don't have a Brand#1 related to Brand#2 models, etc.. I didn't want to have all the models for all the brands in a single table, was I right to think like this?
View 6 Replies
View Related
Nov 9, 2005
My query looks like this...The problem is that when I have one Radio with two records where [Defect fixed?] is false it counts that as two separate radios instead of one. Somehow I need to make it sum records with the same Radio/Serial_number as one...Anyone have any suggestions?
SELECT DISTINCT Defect_Log.[Defect Fixed?], Defect_Log.Station, Part_Number_Log.Type
FROM Part_Number_Log INNER JOIN (Serial_Number_Log INNER JOIN Defect_Log ON Serial_Number_Log.Serial_Number = Defect_Log.Serial_Number) ON Part_Number_Log.[Part Number] = Serial_Number_Log.Part_Number
GROUP BY Defect_Log.[Defect Fixed?], Defect_Log.Station, Part_Number_Log.Type
HAVING (((Defect_Log.[Defect Fixed?])=False) AND ((Defect_Log.Station)="station 1") AND ((Part_Number_Log.Type)="vhf"));
View 1 Replies
View Related
Sep 11, 2004
I have attached a very small table with one query. I need help having the query perform a calculation. NOTE: I do not want to achieve the calculation in a form or a report.
Thanks so much for the help - John
View 3 Replies
View Related
Mar 15, 2008
Hi, i have several tables in my database, wanted to know if the tables between:
Client -----> Theory
Client -----> Practical
are 1 to 1 relationship, right? Client can do one Theory, Practical.. but what if Client failed Theory, is that saying they can do more? I'm confused with the whole logic on this. Any help would be appreciated.
Thank You! :)
View 2 Replies
View Related
Feb 17, 2006
I am redesigning an old database. There is a form that has an unbound combo box field that gets its values from a query. Basically, someone will choose a value from the combobox and a subform will display all records for that value.
Here is my dilemma...
In the old database, if I typed an N in that combo box, it would immediately go to the "N"s in the combo. However, in the new database...nothing happens when you start to type in the combo box. You either have to type the whole thing in or actually use the dropdown button. I have checked every setting imagineable...and I can't find how to get it to autofill based on the letters entered. It is driving me nuts!!!
HELP!!
View 5 Replies
View Related
Jan 14, 2006
Hi
I am having a real hard time with access weared errors. I am using following code:
Me.HistorySymptoms.Form.Refresh 'Just to make sure. It was a try because of error
If Me.HistorySymptomTab.Visible = True Then 'It is a subform in a tab page
For counter = 0 To 29 'Number of fields in the recordset
If IsNull(rs.Fields(1 + counter).value) = False Then ' Just to check Null values
MsgBox rs.Fields(counter).Name 'For debugging
Old_History(counter) = rs.Fields(1 + counter).value 'This line has problem
End If
MsgBox rs.Fields(counter).Name & " Done.||" & counter
Next counter
End If
The error comes in the maked line on accessing the field value. Previously I had another error but after going through the process of "Corrupt Access file correction", I am getting this one. My form has subforms in tabpages. I want to save all the field values to the array on pressing a button. Button is part of the main form and code copies values from a subform. I don't think my file is corrupt as I went through the process twice :-(
Looking for help
RMA
View 2 Replies
View Related
Aug 30, 2005
I've been ask to think of some solution to this problem but i'm no way near of it. I have a txt file (ascii) with aprox. 1845000 lines.
The code is something like this:
"++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++
Date:02-12-2004Time: 11:06:24
Job Number:2542
Job Name:al
Priority:Normal
User Name:msescudeiro
Customer:
Account:1341000
Distribution:
Notes:
--------------------------------------------------------------------------------
Original Filename:C-0884_Vers_E.TIF
recycled paper
Used Area:0
Plotted Area:0
Media:paper
Used Area:4977
Plotted Area:4977
Media:film
Used Area:0
Plotted Area:0
Media:vellum
Used Area:0
Plotted Area:0
Operation Count
Mirror:0
Rotate:0
Zoom:0
Stamp:0
Fold:38
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++
I need to have a table like this:
View 14 Replies
View Related
Feb 15, 2007
Hi all,
im having trouble with an update query wher i need to update one field [class] of a table [txStudents] from an existing query Newfacility_Students where the StudentId in [txStudents] matches the StudentId in Newfacility_Students
thought it would be simple enough
UPDATE txStudents
SET Class = Newfacility_Students.class
WHERE ((StudentId = Newfacility_Students.StudentId));
it's not working it says it prompts me for this Newfacility_Students.class
but when i add that table to the design view it messes up the syntax in the sql view
UPDATE txStudents Newfacility_Students
SET Class = Newfacility_Students.class
WHERE ((StudentId = Newfacility_Students.StudentId));
any ideas?
im going crazy!!
dubs
View 1 Replies
View Related