Results 1 to 13 of 13
  1. #1
    Joemarie11 is offline Novice
    Windows Vista Access 2013 64bit
    Join Date
    May 2016
    Posts
    8

    How to put a Code

    Hello Guys,

    Do you know how to create a code in which I can concatenate fields and also check for duplication? I am using 2 tables one that contains the data and the other one contains the list of fields that needs to be concatenated.

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    An example of WHAT you are trying to accomplish, showing inputs and expected outputs, would help clarify your post.

  3. #3
    Joemarie11 is offline Novice
    Windows Vista Access 2013 64bit
    Join Date
    May 2016
    Posts
    8
    Quote Originally Posted by orange View Post
    An example of WHAT you are trying to accomplish, showing inputs and expected outputs, would help clarify your post.
    Hello Orange, what im trying to do is for example i have table 1 and table 2. In table 1 i have the list of fields in one column that will be used for concatenation. In table 2, i have those fields in a row but contains also fields that i dont want to be concatenated. Then if the concatenation is sucessful how can i check for duplicates?

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Show us some data, input and desired output.

  5. #5
    Joemarie11 is offline Novice
    Windows Vista Access 2013 64bit
    Join Date
    May 2016
    Posts
    8
    Click image for larger version. 

Name:	Table1.png 
Views:	13 
Size:	6.5 KB 
ID:	24633Click image for larger version. 

Name:	Table2.png 
Views:	12 
Size:	9.4 KB 
ID:	24634Click image for larger version. 

Name:	Ouput.png 
Views:	15 
Size:	15.5 KB 
ID:	24635

  6. #6
    Joemarie11 is offline Novice
    Windows Vista Access 2013 64bit
    Join Date
    May 2016
    Posts
    8
    Hello Orange,

    I have posted a sample data above, Table 1 consist of fields and key fields while table 2 consist of the data. For the Output it is somewhat a copy of Table 2 but has Key Field and Duplicate extra fields. For the Key Field it will concatenate the fields that was marked X in Table 1 and for the Duplicate it will check the Key Field if it has a Duplicate. Thank you very much.

  7. #7
    orange's Avatar
    orange is online now Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    OK I see your data. Now my question is WHAT is the purpose of KeyField?
    With Access, there is a query wizard that will help you construct a query to find Duplicates.
    You do not need KeyField to find duplicates in your records. In your example, FirstName and lastName
    will show duplicates when coparing records on that combination of fields.

    If you are trying to make a unique identifier for each record, then use an autonumber.

  8. #8
    Joemarie11 is offline Novice
    Windows Vista Access 2013 64bit
    Join Date
    May 2016
    Posts
    8
    The purpose of the Key Field is that it could cater different types of data. Since Table 2 will be used in different set of data for example the fields there might consist of 20 but I only need to check if it has a duplicate using only 13 fields.

  9. #9
    Joemarie11 is offline Novice
    Windows Vista Access 2013 64bit
    Join Date
    May 2016
    Posts
    8
    Also, Table 1 will always consist of FIELDS and Key Field. The FIELDS column will be the same numbers as to the Table 2 and Key Field column will be different depending on what set of key fields I want to concatenate and check for duplication.

  10. #10
    orange's Avatar
    orange is online now Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I don't understand what you are trying to do.

    With Access, there is a query wizard that will help you construct a query to find Duplicates.
    You can adjust to find duplicates in any combination of fields.

  11. #11
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by orange View Post
    ...I don't understand what you are trying to do...


    And apparently neither do the other 90+ members that have read your post but not replied. Not trying to be critical, but have been doing this for over 20 years and simply have no idea what your end result is supposed to be.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  12. #12
    Joemarie11 is offline Novice
    Windows Vista Access 2013 64bit
    Join Date
    May 2016
    Posts
    8
    Apology If you don't understand what I'm trying to do here. I am trying to create a 1 button program in which once the user inputted the Table 1 and Table 2 with their desired data, the result would then be the Output.xls. This is because our data is not only limited to 10 or 20 fields but also up to a hundreds and thousands. So for example, I have a table 2 that contains 200 fields but I only need to check the concatenated duplicates of 100 fields I am not going to risk that a colleague of mine might concatenate it all wrong. That is why there is a Table 1 in which I can input all the fields and pick the ones that needs to be concatenated in Table 2.

  13. #13
    Joemarie11 is offline Novice
    Windows Vista Access 2013 64bit
    Join Date
    May 2016
    Posts
    8
    If possible can you just give me a code to concatenate. That is the only thing Im missing just the command.

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

Similar Threads

  1. Replies: 20
    Last Post: 10-13-2015, 09:05 AM
  2. Replies: 3
    Last Post: 10-16-2014, 08:49 AM
  3. Report Code is not allowing return to main code
    By rcwiley in forum Programming
    Replies: 2
    Last Post: 06-16-2013, 10:31 AM
  4. Replies: 7
    Last Post: 05-28-2013, 09:11 AM
  5. Replies: 1
    Last Post: 05-04-2013, 12:19 PM

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