Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    cliff.clayman is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    55

    Yes, it is possible to have an organization with a comma in the name. I missed that in the sample data. ABC, Inc. does exist is the data. Also, in the macro:

    Set db = CurrentDb
    Set rs = db.OpenRecordset("FM0034")
    Do While Not rs.EOF
    nm = rs!Insured_Name <------ Do I have to explicitly name the field name here? Will it only work for the one field I define?

  2. #17
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,958
    The comma was assumed to be the 'tell' that the value was a person's name. The code would have to be modified to look for other indicators of an organization, such as "Inc", "LLC", "DBA", "Corp", etc. Maybe "Inc" is the only one with a comma, if so, the code modification is relatively simple.

    Orange's code uses specific field in the Sub. The Function does not - the field is specified in the Function call.

    Why are you using the Sub?
    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. #18
    cliff.clayman is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    55
    I'm not. I was just making sure I didn't need to alter it.

  4. #19
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,958
    Issue resolved?
    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.

  5. #20
    cliff.clayman is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    55
    Not quite. I still have an issue with the corporation/company names. The code currently takes out a comma if there is one and then the match fails. I have some corporation/company names like 'ABC Inc.' and some like 'ABC, Inc.' I also have some suffixes that are splitting the names incorrectly as well. Joe Johnson, DDS becomes DDS Joe Johnson and fails the match. I need some way to not reformat those type.

  6. #21
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,958
    That means more conditional statements in the code to test for each possible situation. This is why parsing string data gets very unwieldy. Consistency in structure is critical. Otherwise you face the GIGO syndrome (Garbage In Garbage Out).
    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.

  7. #22
    cliff.clayman is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    55
    Yeah, unfortunately I have no ability to change the data that is coming in. It is a weak front-end that allows all these different formats to come through. Things like this are not thought about when it comes to reporting and then analysts like me are stuck trying to work around it.

  8. #23
    cliff.clayman is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    55
    The function fails when I have a name like this:

    Walter J Jackson, DDS, MS, PA

    How can the function be modified to accommodate for this?

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Build Expression in Query
    By rwpspackett in forum Queries
    Replies: 1
    Last Post: 11-23-2015, 02:16 PM
  2. Replies: 4
    Last Post: 05-26-2015, 12:21 PM
  3. Replies: 3
    Last Post: 08-18-2014, 10:11 AM
  4. Replies: 1
    Last Post: 03-13-2014, 03:02 PM
  5. Issues with Text Box formats and expressions
    By AndrewsPanda in forum Reports
    Replies: 3
    Last Post: 09-28-2011, 11:32 PM

Tags for this Thread

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