My Problem: I have acquired 200 customers in one month, and I have to MANUALLY assign each bulk mailing recipient. This will not do. I've experimented with Queries to do the work for me, but keep tripping over a foreign key violation.
My Question: How can I create many records in the Mailing table with a constant Newsletter ID and whichever contacts my Select query returns? How do I populate the SECOND foreign key (the constant Newsletter ID) so I don't get the key violation?
I thought about doing a Make Table Query based on my Select Query, then an Update query to create the second foreign key, then an Append query with all the values in place. Is there an easier way?
I feel like this should be really easy, but two weeks of tinkering have gotten me nowhere. A nudge in the right direction would be greatly appreciated.
hi Guys, I have been looking at different post and checking Microsoft help files as well, but still can't seem to fix this problem.
I am having 2 tables. The first table is connected to a form for viewing and entering data, and in the second table i am just copying 3-4 fields from the first table.
I am trying to use the insert statement to insert records in the second table, and everytime i click on the "Add" button to add the records i get the following error "MS access can't append all the records in the append query ... blah blah blah"
However if i close the form and reopen it, and goto the record (as it is saved in the first database) and now click on the add button to add the fields to the second table/database, it works.
Ive got problem with defining foreign key i explain what table ive and what i want between my Student ,Session there is many to many relation that student session connect them together
student: Format student session: Format Student ID Autonumber Student ID Autonumber student name Session ID Autonumber student address student dob..... ....
Session: format
Session ID Autonumber dance days dance time no of student
the student id is primery key and session id is primery key ,student session is compound key of this 2 but it wont work it keep saying u can only have one auto number in one table #
Hey all, i'm new here! I've spent hours upon hours trying to solve this problem, but it's got me nowhere, so I think it's time to ask for help! I'm not exactly an Access beginner (I generally know what i'm doing) but this has me stumped!
Ok, basically my DB has several tables.
Staff (main table) Qualifications Institutions
The problem is - i'm trying to set it up so the fields "qualificationName" and "institutionName" in the staff table extract the data from the fields with the same names in the qualifications/institutions tables.
I've tried linking the fields together as foreign keys, but when I go to set referential integrity, I get the error "No unique index found for the referenced field of the primary table"
staffID in each table is linked properly, but that's as far as it will let me go!
hi i am new to access 2003 ,i would like to know how do i tell access which attribute is foreign key of another primery key ,for example if i have two table 1.student 2.order i want to have student id as foriegn key in order how would i do that ? thanks
i have a form with a sub-form on it. each has is bound to a table. the main form's table has a one to many relationship with the sub-form table, and the sub-form table has the PK of the main table as a FK.
every time i try to add a second record to the sub form, it gives me an error saying i cant have duplicate foreign keys.
i cant figure out what to do. i am using access 2003 and microsoft sql server version 8. i need to enable duplicate foreign keys so that each record of the main table can have more than one record in the sub table.
I have a table with Client info, I then have child tables with info on what workshops the client has attended or if the client recieved services. The idea is to use "ClientName" as the primary key in the main "Client Info" Table and then use this same field as the Foreign key in the smaller child tables. Everything seems to work out except if I want to "Enfore Referential Integrity" in the relationship. When I try to do that I get this error message:
Relationships must be on the same number of fields with the same data types
i am creating a database and i had created two tables one is holidays and second is departure date.. in the holidays table the primary key is holiday code. and in the departure date table the primary key is Departure Key and there is also field is Holiday Code. now i had create two tables and then i had insert both the table in one but the problem is this when i am changing the primary key's data of holidays table but the rest field is not changing.. i think its need to assign foreign key but i don't know how to do that can u plz tell me how to insert the foreign key.
i doing my assignment and i am stuck here plz reply me soon so that i can move further..
On the mainform [frm1930Census] I have a couple of subforms [sbf1930CenHeader & sbf1930CenDep]
The primary key [FTMID] has passed from the mainform to the 1st subform [sbf1930CenHeader] correctly. Using the one to many relationship attached by the [FTMID] field.
The problem is the primary key [1930CenHdrID] from the subform[sbf1930CenHeader] should then travel to [sbf1930CenDep] which it does not. The relationship between the two subforms are one to many focusing on the [1930CenHdrID] field/
I am using the following code:
Private Sub Ctl1930CenHdrID_BeforeUpdate(Cancel As Integer) Me.1930CenHdrID = Forms![frm1930Census]![sbf1930CenHeader].[Form]![1930CenHdrID] End Sub
I´m trying to improve my appl. but I´m stuck trying to figure out how to append multiple rows on a table using the Append query.
My problem comes since I have 4 tables with the following fields: 1) Orders OrderID (number) CustomerID (number) Date (date) etc... 2) OrderDetails OrderDetailID (number) OrderID (number) ProductID (number) QuantitySold UnitPrice etc... 3) TmpOrders OrderTmpID (Autonumber) CustomerID (number) Date etc... 4) TmpOrderDetails OrderDetailTmpID (Autonumber) OrderID (number) ProductID QuantitySold etc...
The problem comes since the Tmp tables are used just to record temporarly the information before the transaction is completed. Whe the salesman at the desk finish the sale, a command button is presseed and an append query runs to transfer the data from Tmp tables to the Definitive tables. Another query (Delete) is excuuted inmediately after the append qry. and it deletes the information recorded on Tmp tables.
I need to reset the autonumber or create a field that records the line number so I can add up to the Maximum OrderDetailID found on the definitive table, but the problem is how to create the "controlled" autonumber.
Hi, I'm trying to create a basic database to track customers and to log conversatons/activity with the company.
I've two tables. One to hold the company info (e.g. comp_id, comp_name, comp_address, etc. etc.) and another to hold the conversations/history (e.g. hist_id, hist_date, hist_detail and comp_id which is the foreign key).
The problem I'm having (and it's probably basic) is that I've created two forms. One to display the companies and one to show the history of a particular company. I've added a button on the companies form which opens the history form (based on the selected record) where the two comp_id's match however, if I try to add a new conversation/history the comp_id foreign key isn't updated with the current comp_id and therefore isn't shown the next time I view the history of that company.
The tables are joined on the comp_ids as a one to many relationship.
Apologies if I haven't explained very well. Still finding my way with access.
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.
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.
I have done multiple searches with no luck- sorry to ask such a basic question, but I want to know the correct way of inserting a foreign key into a table.....I was told to Insert - Lookup field - in my main table - is that correct?
Builder Subdivision Lot Number Lot Option Lot Materials Details
The [Lot Materials Details] table is populated by appending data from the [House Type Details] table tree as follows:
Builder House Type Elevation Options Per Elevation House Type Materials Details
The filtered Option Table in both branches determine which [House Type Materials Details] records get appended to the [Lot Materials Details] table.
The question is: Is there any advantage, other than simpler queries later on, to adding the primary key from the [House Type Materials Details] table to the [Lot Materials Details] table.
It’s redundant because the [Lot Options Table] contains the [Options Per Elevation] primary key.
hi i need to create a table, i've figured out to make LastName the primary key. But im not so sure about the foreign key, and whether it is necessary to put it into the table in order for all my tables to relate? Sorry if this doesn't make much sense. Also, to clarify.. 3NF primary keys in one table cannot be used in another table?? thanks
I'm using Allen Brownes very helpful cascade-to-null relations (http://allenbrowne.com/ser-64.html) code in my database project, but there comes problems whit a foreign key and null values, cause foreign key shouldn't be null. Is there anyone else using this method with relational tables? What I should do to make this work?
All hints and tips are welcome and approciated, thanks on advantage. =)
Wow, I've found some good stuff here already... Thanks.
PROBLEM: I have a table(we'll call it shipping) that has two columns FK'ed to another table (locations). My problem is I have no idea how to pull the information from the locations table into the shipping table.
DESCRIPTION: My shipping table has a source and a destination column. Now, I have a fixed location list that applies to both columns and I'd like to avoid having a source tbl and a destination tbl... I'm an Access Neophyte to say the least (for now at least) but I have managed to put together a querie that pulls out most of the information that I need (name, phone number, yadda, yadda, yadda) but I can't seem to correctly link the FK's for the sources to the locations table as well as the FK's for the destinations to the locations table. When I run my querie I get an error or my Source(destination) column will display the correct information but the Destination(source) column will display ALL of the locations in the location table. Here's what I mean:
Source destination detroit toledo detroit cleveland detroit San Diego detroit London detroit Paris detroit detroit Paris toledo Paris cleveland Paris San Diego Paris London Paris Paris Paris detroit
. . .
The first and second source was detroit and Paris but the Destinations list all of the locations I have in the table.
How can I link two FK's in one table to another table in a querie?
When I view data in linked tables in MS Access containing foreign characters (umlauts, accents, etc), the foreign characters are not being displayed properly. It is not a font or Access setting because I am using a separate similar database (also containing linked tables) where the foreign characters are being properly displayed.
Is there a setting I'm missing in the linking of the tables? Not sure where else to check.
I have two tables in my Db: tblMaster & tblAddresses. They are joined with a one-to-many relationship, with the addresses being the "one" side. Many entries in tblMaster have the same address.
I use a form, based on a query, to add records which creates the new vendor in tblMaster, and (if I have contact details), a record in tblAddresses. The problem is that while the PK is created in tblAddresses once I add the address info, the related FK field in tblMaster is not populated with that #.
I have a database - which was originally made up of two tables that were not linked.
So I split one table into two and then populated a linking table to link to the other table. Up till I wanted to integrate the second table it all worked with test searches etc working perfectly.
Ok in my linking table I have a field fk_MemorialId which should link to the memorial table field MemorialID which is a primary key.
However the fields in the table are Mlink,Inscription,Links,PLot and GraveNo and None are unique.
ie Mlink can refereed to several graves , links is an empty field, GraveNo and PLot refer to a location that can have severed bodies is it. Innscription again is not unique and illogical as it sounds the inscriptions in the table tblmemorial bear little similarity to the inscription filed in the other tables I suspect the original developer gave up on linking.
How to populate this linking field.
I do realise that in the relationship chart below fields are duplicated and will delete them but I was hoping to use the fields as criteria for an update.
I'm having an issue with foreign language characters (that have accent marks) not being accepted in our database input fields when a user tries to enter them into the textbox. i've enabled foreign languages, checked help menus, used the character map in accessories, and even tried using the alt+# method but to no avail.
since our company works with many foreign countries, many of the firms names have all sorts of crazy accents (à ã ç ö š ǐ ø) and as you can see from that example, one already showed up incorrectly as a box instead of an "i" with the "u" looking accent above it. I've attached a screenshot to this post so you can see what i'm talking about, however in the example it's the "s" with the "u" looking accent that doesn't show in access, as opposed to the "i" replaced by a box in this post.
My question is, is there any way of adjusting our system so as to make sure all accents are allowed? If you also have a list of steps that I can follow, I can try to redo it your way since the ones I've tried have not worked.
Any help would be greatly apprecaited. Thanks in advance!