Results 1 to 12 of 12
  1. #1
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114

    Multiple Entries On A Same Person

    im doing a database for CV (curriculum vitae) of employees.

    i have a challenge in adding records (Working Experience) in a same person. i have a button in a Form says Add Record but when I add a record it will go to the next entry (in Table). does anyone knows here how to work this that when I add an entry/entries it will be added to the same person, not next, not new, but same person. any codes that i should incorporate in the command button?

    Thanks

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 64bit Access 2013
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    With out seeing your total structure, this is a shot in the dark. Consider two tables and using Sub Forms. Look at this link.

    http://www.datapigtechnologies.com/f...subforms1.html

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    I believe it really is just the definition of terminology: Add record can mean add a new person - or - add a new record to the existing person (presuming there is a sub form to do that). The command button is not what you are expecting but is probably ok for what it is meant to do. Can't be more specific on a fix without knowing your data structure but to add more records about the same person then one must have a continuous sub form typically.

  4. #4
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    Quote Originally Posted by alansidman View Post
    With out seeing your total structure, this is a shot in the dark. Consider two tables and using Sub Forms. Look at this link.

    http://www.datapigtechnologies.com/f...subforms1.html

    oh sorry i keep on editing my reply... this one is working but i cant save the new records. this will only show existing data but how about new data? lets say Sam Smith has data, and then i will add more data under him, when i save it cant, the error is below:

    "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 redefinethe index to permit duplicate entries and try again."

    problem is that i cant redefine the duplicate set to YES and change the primary key.

  5. #5
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    Quote Originally Posted by NTC View Post
    I believe it really is just the definition of terminology: Add record can mean add a new person - or - add a new record to the existing person (presuming there is a sub form to do that). The command button is not what you are expecting but is probably ok for what it is meant to do. Can't be more specific on a fix without knowing your data structure but to add more records about the same person then one must have a continuous sub form typically.
    i guess its the same suggestion with one above you? but my problem is the new record/s for the same person cant be saved.

  6. #6
    lzook88 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    75
    Can you upload your database? That way we can see what you are working with?

  7. #7
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 64bit Access 2013
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    Attached is a simple db with two tables and a form with a subform. One table has the donor information. The second table has information about the donation. The tables are linked via a primary key and foreign and are represented in the form and subform
    Attached Files Attached Files

  8. #8
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    thank you all for your replies. i think i got it now... but let me check further especially the reporting..

  9. #9
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    the reporting has a problem. anyone knows what code i should place either in Event Procedure or Macro that i want to get value of the specific ID of a certain person..... like Sam Smith has 223366 ID and i wanted to get his records ONLY because now when i make the report it will give me all the records in the Table.

  10. #10
    lzook88 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    75
    something like below is what you are going to want to go with. This way you can change who the report is consistently.. Does your report have their name on it or their ID number?

    Code:
    'to open it based on their ID Number
    DoCmd.OpenReport "REPORT NAME", AcViewReport, , "[ID]=" & (idnumber) & ""
    
    'to open it based on their NAME
    DoCmd.OpenReport "REPORT NAME", AcViewReport, , "[Name]='" & THEIRNAME & "'"
    To select which person you want a report on, I suggest a combobox of some sort to pick from in a separate form.

    Zook

  11. #11
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    Quote Originally Posted by lzook88 View Post
    something like below is what you are going to want to go with. This way you can change who the report is consistently.. Does your report have their name on it or their ID number?

    Code:
    'to open it based on their ID Number
    DoCmd.OpenReport "REPORT NAME", AcViewReport, , "[ID]=" & (idnumber) & ""
    
    'to open it based on their NAME
    DoCmd.OpenReport "REPORT NAME", AcViewReport, , "[Name]='" & THEIRNAME & "'"
    To select which person you want a report on, I suggest a combobox of some sort to pick from in a separate form.

    Zook

    thanks for your reply.

    name and ID number are there in the report.

    combobox? i think not a good since there will be like 600 records in it.

    i try to experiment with your code now and update my thread once done.... again, thanks.

  12. #12
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 64bit Access 2013
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    Instead of a combo box, you could build a custom filter. See the following link.

    http://www.datapigtechnologies.com/f...tomfilter.html

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

Similar Threads

  1. run multiple reports and email to correct person
    By craig1988 in forum Modules
    Replies: 4
    Last Post: 11-05-2014, 12:47 PM
  2. Replies: 1
    Last Post: 04-14-2014, 12:29 PM
  3. Multiple work areas in on person record
    By pmcginn in forum Access
    Replies: 1
    Last Post: 05-24-2013, 09:35 AM
  4. Replies: 7
    Last Post: 10-30-2012, 02:18 PM
  5. Replies: 1
    Last Post: 03-18-2012, 04:00 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