Results 1 to 9 of 9
  1. #1
    wildthingcg is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Aug 2011
    Posts
    20

    Table Not Updating Correctly

    When entering data into forms all tables update correctly except Employers. See EmployerID 1 and 11. Data should all be for EmployerID 1, the JobCardNbr 11 is being entered in as EmployerID 11. Any help in fixing this would be greatly appreciated.

    Thanks,


    Cheryl

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Not understanding the issue. As far as I can tell the Employers form and its subform are working properly.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I'm stumped what the problem is too, like june the form you mention is correctly applying the jobcard number in the correct field in your JOBS table.

  4. #4
    wildthingcg is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Aug 2011
    Posts
    20
    June7 & rpeare thank you for your replies. I'm really new at this so sorry if I've confused you at all.

    If you go to the Employers FORM you will see that EmployerID 1 has data entered in the Jobs SUBFORM for JobCardNbr 11 (which corresponds to JobsID 1 in the TABLES). If you then go to the different TABLES for all of the SUBFORMS, you will see that they all show the correct EmployerID, JobsID and JobCardNbr. Finally, go to the Employers TABLE look at EmployerID 1 and there is nothing entered. But if you go to EmployerID 11, you will see that is where the data is entered. The 11 SHOULD represent the JobCardNbr NOT the EmployerID #.

    I hope this makes more sense.

    Thank you for your help!

    Cheryl

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Ok, well the problem may be that you can have the same JobCardNbr for multiple customers. What you really should be doing is linking all the sub forms on your tab control by JOBID. JobID is the unique identifier for your JOBS table not the JobCardNbr. The JOBID is in turn linked to your EMPLOYERS table via the EmployerID field.

  6. #6
    wildthingcg is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Aug 2011
    Posts
    20
    rpeare,

    Actually, there should be only one JobCardNbr per Job (a Job is the Jobs SUBFORM plus the Tabbed SUB-SUBFORMS, Benefits, HowToApply, etc.) and no duplicate JobCardNbr(s) between Employers.

    Cheryl

  7. #7
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Ok, well... here's what I think happened. It looks like when you originally set up your relationships you joined Employers and Jobs from EmployerID to JobCardNbr, then at some point realized that was wrong and re-established the link to the correct field but the relationship, for some reason, is not correctly updating when you look at your table. So here is what I did.

    I created a new table copied the structure of the Employers and called it EmployersNew

    Created an append query with this statement:

    Code:
    INSERT INTO EmployersNew ( EmployerName, Address, City, StateCode, ZipCode, PhoneNbr, ExtNbr, FaxNbr, EmailAddress, WebsiteAddress, PriContactFirstName, PriContactLastName, SecContactFirstName, SecContactLastName, Marketing, DoNotCall, Notes, ReferredByFirstName, ReferredByLastName )
    SELECT Employers.EmployerName, Employers.Address, Employers.City, Employers.StateCode, Employers.ZipCode, Employers.PhoneNbr, Employers.ExtNbr, Employers.FaxNbr, Employers.EmailAddress, Employers.WebsiteAddress, Employers.PriContactFirstName, Employers.PriContactLastName, Employers.SecContactFirstName, Employers.SecContactLastName, Employers.Marketing, Employers.DoNotCall, Employers.Notes, Employers.ReferredByFirstName, Employers.ReferredByLastName
    FROM Employers
    ORDER BY Employers.EmployerID;
    When you open the table the datasheet should have no + sign in the far left column.

    Go to the Relationships setup, link the EmployersNew to Jobs through the EmployerID

    Delete the relationship between Employers and Jobs.

    Open up the table EmployersNew, verify that when you hit the + sign it's showing you the correct related records.

    Rename the table Employers to something else
    Rename the table EmployersNew to Employers

    Everything should work as you originally intended (I didn't do full testing but it appeared to for me)

    I *never* set up relationships in my database so someone who knows more than I do may be able to give you an easier way to do this.

  8. #8
    wildthingcg is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Aug 2011
    Posts
    20
    Thank you, rpeare!

    I will try this and let you know what the outcome is. I really appreciate your help.

    Cheryl

  9. #9
    wildthingcg is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Aug 2011
    Posts
    20
    rpeare,

    Works like a charm. You ROCK!

    Thank You,

    Cheryl

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

Similar Threads

  1. Replies: 0
    Last Post: 03-27-2011, 02:05 PM
  2. Updating value in another table
    By nostr4d4m in forum Queries
    Replies: 2
    Last Post: 03-23-2011, 08:05 AM
  3. Updating my table through VBA.
    By pedie in forum Access
    Replies: 1
    Last Post: 01-26-2011, 08:40 PM
  4. Replies: 16
    Last Post: 08-19-2010, 01:40 PM
  5. Table not updating (Anyone Please Help)
    By goyal_cyber in forum Queries
    Replies: 7
    Last Post: 05-28-2010, 09:42 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