Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    wallstreet is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    12

    The GetType module is showing in the Unrealted Objects category

  2. #17
    wallstreet is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    12
    Could it be a Reference that is not checked? In the VB editor? Maybe easier if you send back the DB itself.

  3. #18
    wallstreet is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    12
    I got it to work. I named the module the same as the function. Guess you can't do that!

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    That is the case. A module can have many procedures - Sub and Function.
    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
    wallstreet is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    12
    June, I am getting a Run-time error '94': Invalid use of Null when I run this across all of the records that I have. What can I add to the function that if the parsed fund name is not found in the criteria rules to return the existing asset classification and not an error?

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Change last line of function to:

    GetType = IIf(strType = "", Nz(DLookup("[Asset Type]", "[Copy Of Rules]", "InStr('" & Replace(strFund, "'", "''") & "', [Criteria])>0"), strFund), strType)
    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
    wallstreet is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    12
    Thanks June, that worked. The issue I now see is that I added in another fund 'CALL ISHARES MSCI BRAZIL FREE AT 60 000 EXPIRES 01'. This is matching on the 'All' portion of 'Call'. Is there anyway for it to match only the whole words?

    Also, the 'CALL UTILITIES' fund is coming back with Equity as the Asset Type (which is correct) but I put in the CriteriaMatch expression that you suggested and it is matching on the same value as the 'CALL ISHARES' but returning a different value. Weird.

  8. #23
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Like I said, can't achieve perfect.

    'CALL UTILITIES' returns 'Equity'.
    'CALL ISHARES...' returns 'Blend'

    I don't see them matching on same value. The first matches on UTILITIES in the loop; the second matches on ALL in the second-chance match at end of code. This line tries to find a Rule Criteria anywhere within the Fund Name but only uses the match if the preceding loop is unsuccessful, hence the match between 'CALL ISHARES...' and ALL. So if TECHNOLOGY was not in the Rules a match would be made on criteria TECH for Fund Name of TECHNOLOGY. If you would rather just return 'No Match' for records that don't have a full word match, then the last line could be:

    GetType = IIf(strType = "", "No Match", strType)
    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.

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

Similar Threads

  1. Replies: 8
    Last Post: 03-22-2012, 08:48 AM
  2. Replies: 5
    Last Post: 08-29-2011, 05:17 PM
  3. Replies: 2
    Last Post: 07-07-2011, 08:25 AM
  4. find value of selected field in a table
    By Bic in forum Programming
    Replies: 1
    Last Post: 02-05-2010, 07:40 PM
  5. Parse a File from a Directory and write data to table
    By galahad in forum Database Design
    Replies: 0
    Last Post: 04-23-2009, 08:38 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