Results 1 to 9 of 9
  1. #1
    feenixfire is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2011
    Posts
    4

    Searching column history

    Hi all,


    I've got an inventory DB in access 2010 where i track our assets. In my asset table there's a "comments" field (memo type) with the comment history. I got this from the northwind assets db or the access built in inventory db, don't recall which one. Anyway, the comment history has been awesome but i need to search the history and i can't. For example 1 asset in the history, if i view the history, i can see was first assigned to jsmith but when i search for "smith" it doesn't appear because it's in the comment history. Any suggestions would be greatly appreciated!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    How are you doing this search - with the Access shortcut menu, in a query, or in VBA code? I just tested searching and filtering for a string within a memo field by using the shortcut menu and a query and it worked.
    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
    feenixfire is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2011
    Posts
    4
    I've tried a query and ctrl F. I'd like to avoid code. So here's my scenario, maybe it'll clear things up. I have say 10 records. In the memo field i named "comments" i have jsmith for the last comment. However, in another record, i had a comment months back named jsmith which does not show up in the table because i've put in new comments since then. If i right click on the field, and view column history, i can see that old comment and when i entered it. When i do a query or CTRL F, for the word "smith", all that will show is that first record with the recent comment. Searching/querying does not appear to search the history of the memo field and from what i can tell access hides where that data is.

    Quote Originally Posted by June7 View Post
    How are you doing this search - with the Access shortcut menu, in a query, or in VBA code? I just tested searching and filtering for a string within a memo field by using the shortcut menu and a query and it worked.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Still confused. What do you mean by 'column history' - all records? Why would a more recent record prevent an older record from showing?

    I am hoping this is not a multi-value field.

    Do you want to make project available for analysis, or at least just this table?

    You might find this recent thread of interest https://www.accessforums.net/queries...ory-15580.html
    Last edited by June7; 08-01-2011 at 08:41 PM.
    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. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If you're searching a memo field you'll want to search with LIKE

    like * & [Enter Search Text] & *

    this should find anything that has the text string you enter if you search on the memo field.

    EDIT: I don't know what type of results you'll get with ctrl-f this, I'm talking about building a query that will perform the search, not using the innate windows search function.

  6. #6
    feenixfire is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2011
    Posts
    4

    history issue

    OK i know it's confusing, i've gone round and round with my SQL buddy on this, so hopefully this attachment uploads. I made a table, 2 fields, username and comments. The comments field is a memo type, append only as yes. So, open the table and look at bob's comments. It states "wait I meant he's really mean" but if you right click that comment, then click show column history, you'll see that a minute earlier i put a comment of "bob is a good guy". It tracks what i've entered and when i changed it. No matter if i use crappy ctrl+F (completely agree with you on that one BTW) or LIKE in an SQL query, if i search for the word "good" that i know is on a previous comment, it will not pull that record. This historical data has got to reside somewhere and unfortunately this is an issue i wasn't aware of for quite some time so i'm looking at recreating all comments one by one. Hopefully that clears up the issue and I'm hopefull you gurus will have an idea on what i can do to fix it. Thanks for the assist!!!

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Well that is a column property I never explored before. Access is saving the previous entries somewhere. I set project so I can view hidden system tables. None of them show this data.

    I did find one reference that stated this data is stored in a multi-value type field. But it doesn't act like a multi-value Text datatype field.

    EDIT: VBA can retrieve, check page 60 of this pdf http://www.msoffice.us/Access/PDF/Us...ess%20Data.pdf
    and this article http://msdn.microsoft.com/en-us/libr...ffice.12).aspx

    I typed this in the VBA immediate window:
    ?Application.ColumnHistory("test","Comments","ID=2 ")
    and the output was:
    [Version: 8/4/2011 3:37:35 PM ] comments
    [Version: 8/4/2011 3:37:44 PM ] bob is a good guy
    [Version: 8/4/2011 3:38:14 PM ] wait I meant he's really mean
    Last edited by June7; 08-05-2011 at 11:05 AM.
    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.

  8. #8
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    You can view your history in a query with this kind of code:

    SELECT ID, Comments, ColumnHistory("test","Comments","[ID]=" & Nz([ID],0)) AS CommentsHistory
    FROM Test

    You can do searches for *good* in the comment history field as well so it may do what you want.

    It will show the most recent comments and the comment history. If you want to undo the add only property of the memo field you would have to write some code to read all the history comments and append them as one block of text in your 'current record' then change the field from add only to a normal memo field. Just make sure you are not working on your original data in case something goes wrong

  9. #9
    feenixfire is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2011
    Posts
    4

    Fixed!

    Dude you guys rock thank you so much. I tried the SQL and the VB, both worked great and exactly what I wanted. Thank you SO MUCH!

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

Similar Threads

  1. Column History
    By linles01 in forum Access
    Replies: 1
    Last Post: 04-14-2011, 04:20 AM
  2. Creating a History
    By mwabbe in forum Access
    Replies: 7
    Last Post: 08-19-2010, 09:16 AM
  3. Access records with history
    By crosbytr in forum Database Design
    Replies: 0
    Last Post: 03-21-2010, 06:08 PM
  4. Comment History
    By botts121 in forum Programming
    Replies: 0
    Last Post: 07-02-2009, 01:02 PM
  5. Client History
    By janjan_376 in forum Access
    Replies: 1
    Last Post: 06-23-2009, 02:44 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