Results 1 to 8 of 8
  1. #1
    vickimurray is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Location
    Oklahoma City, OK
    Posts
    22

    Forms will not allow new records

    I have a new table--Candidates. The table does not have any relationships but does query two other tables to look up date (example: enter zipcode and it fills in City, County and State from that table). Currently there are only two sample records in the database--both were entered in the tables datasheet view with no problem. The only index is the primary key--no duplicates allowed.



    I have created a new form to enter records and/or view existing records. It does view the two existing records but when I try to enter a new record, no matter what I enter I get the message "The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index or redefine the index to permit duplicate entries and try again."
    I have tried everything that I can think of and cannot for the life of me figure out why I am getting this message. Any help???

  2. #2
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    You are getting the error message because you must be trying to enter data that coincides with an already existing/entered primary key. What field is your primary key and what data type is it? I would recommend just having an ID field with autonumber for your PK and this will ensure you don't get that message.

  3. #3
    vickimurray is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Location
    Oklahoma City, OK
    Posts
    22
    Currently my primary field is an ID of Text--7 characters created by the first 4 letters of the last name + first letter of first name + 2 (incrementing) digits. I have used this same format in another unrelated table. I tried adding an autonumber field as primary and changing this format (thinking that the indexes for the two table might be a problem) but that did not solve the problem. The test data that I have entered is nothing like the first to records and it does not matter how I change it

  4. #4
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    Two indexes for the same table is OK, so long as you search on the non-primary key index at some point in your db (like in a query- otherwise it is useless and taking up memory).

    You are sure you have no relationships built in between fields?

    Perhaps you can upload the db for viewing? Remove any sensitive data if applicable, (maybe not since you said it is dummy data), run a C & R, zip db, and attach

  5. #5
    vickimurray is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Location
    Oklahoma City, OK
    Posts
    22

    Form will not allow new records

    I removed all the queries and reports and have some sample data for all tables and forms. My problem is with the "1stLook Candidates" form. Thanks for your time and assistanceBusiness Connections--sample.zip
    I hope that I attached this correctly.

  6. #6
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    Alrighty, here is the issue I was able to locate...

    So your form's record source is a derived from a query connected 3 tables on similar fields- no problem, the table of Zipcodes, the 1st look candidates table, and a third table of industry names, correct?

    In your form the control source for your '#1 Industry' textbox under Work Experience Overview is 'JFIndustryName'. This is the primary key for your table ZZ JFIndustryList. You will want to switch the control source to WkExp1Industry since it seems those are the 'connected' fields (from the query builder) and WkExp1Industry is in your 1st Look Candidates table (where I assume you want the data to be stored). The 'JFIndsutryName' should only be used as a reference for the combo box not the control source. This is where you are getting that error message from. When I switched it on the db copy you gave I was able to enter records no problem.

    Some images to aid in understanding:

    Query Builder Image: Showing the two related fields you will want to switch as control sources for your ComboBox
    Click image for larger version. 

Name:	capt1.PNG 
Views:	10 
Size:	34.3 KB 
ID:	21463


    In the Form, switch JFIndustryName as control source to WkExp1Industry:
    Click image for larger version. 

Name:	capt2.PNG 
Views:	10 
Size:	13.5 KB 
ID:	21464
    Last edited by nick404; 07-30-2015 at 12:00 PM. Reason: add'l information/clarity

  7. #7
    vickimurray is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Location
    Oklahoma City, OK
    Posts
    22
    If I am following correctly your directions, it is not having the desired results. Each candidate can list up to four past work experiences. Each work experience will identify an industry for that work experience with the associated job title. When I changed the control source to JFIndustryname, it entered the industry that was selected into all four work experience listings and into the work experience listings for the existing candidates. I need the dropdown to show the JFIndustryName listing, select one for the WkExp1Industry field, enter an associated job title into WkExp1JobTitle, then go to the same process for work experience #2, #3 and finally #4.
    Does that make sense--I know what I want just not sure I'm explaining it correctly. The JFIndustryList table is just a lookup table for these four fields.

    OK, I just took the FORM query builder and removed the JFIndustryList from the query. I have the Control source as the field I want the data saved in and then the select query is from the JF Industry Name field and it's working now.

    How do I mark my thread as solved? I can't seem to find that.

  8. #8
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    Quote Originally Posted by vickimurray View Post
    OK, I just took the FORM query builder and removed the JFIndustryList from the query. I have the Control source as the field I want the data saved in and then the select query is from the JF Industry Name field and it's working now.
    Precisely what I was attempting to say! Although may have gotten lost in my post haha
    Glad you have it working now!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 08-26-2014, 09:55 AM
  2. Replies: 5
    Last Post: 03-01-2013, 09:17 AM
  3. Hide Records In Forms
    By data808 in forum Forms
    Replies: 4
    Last Post: 08-26-2012, 12:23 PM
  4. Continuous forms records missing
    By KWarzala in forum Forms
    Replies: 2
    Last Post: 12-28-2010, 12:42 PM
  5. table records/forms
    By Sarge, USMC in forum Forms
    Replies: 14
    Last Post: 10-26-2010, 08:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums