Results 1 to 13 of 13
  1. #1
    NikoTheBowHunter is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    58

    Creating a notes history text box/database view???

    On my form, at the top, is a drop down box, where a device number can be selected. Once a device is selected it populates the fields so updates can be done. On this same form, I would like to put some kind of box at the bottom, so a user could scroll through and see the history of the device. I don't need to track changes, when they were changed and by who, just a simple box that a user could add notes to, which then gets added to the notes history for that one record. If this is possible, how would one go about achieving this?

    example, towards the bottom of my form, it would look like:

    Enter notes here: [ How to add this note? ] {add notes button} --which would then add to the note blow in order by date.

    -----------------------------------------------------
    | 05/31/2017 | How to add this note?
    | 04/22/2017 | bla blab blab
    | 03/01/2017 | asdfdfadf asdf fadf



    Would I need to create a new table and some how link the primary IDs so that the list only populates the notes for that one ID when viewing the record? Please also feel free to guide me towards any tutorials that have already covered something like this.

    Cheers.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Simplest would probably be a text field with a text box that wasn't editable. Use another textbox and your button, with code like:

    Me.MainTextbox = Date() & " - " & Me.AddTextbox & vbCrLf & Me.MainTextbox
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    NikoTheBowHunter is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    58
    I have little coding experience, so forgive my ignorance here. With the above mentioned code, when I'm scrolling from record to record, will the notes populate based on the record I'm viewing? If it will, how is it stored in the database on the back end?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Since you said you didn't really need tracking, my suggested method would use a field in the same table the form is based on. Depending on how much you want it to hold, a regular text field or memo/long text. Since that field would be in the same table, it would change as you moved through records.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    NikoTheBowHunter is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    58
    Makes sense. Just to make sure Im following this correctly.
    Take the existing Notes field which I think is limited to 255 characters, change the properties to memo/long text, lock it so its can't be edited (on the form).
    Add a new (unbound?) text box to the form where new notes can be entered
    Add a new "submit/new note button" and then take the above code and insert it into the onClick via code builder(??) i think it is.

    Could you highlight/make bold/change color of what text I need to modify to adapt it to my form/fields?

    Me.MainTextbox = Date() & " - " & Me.AddTextbox & vbCrLf & Me.MainTextbox

    Do I need to some how link the new text box where notes will be entered to the text box where the notes will be displayed or will the code do this?

    Will the code add a "return" before each new entry (i.e. dropping the previous notes down a line)?

    Sorry for the many questions, Im at home and won't be able to test this until I get to work tomorrow. Thanks again for the help on this.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Sounds like you've got it. You'd change the bits after "Me." to your names. Yes, the vbCrLf is a line feed.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    NikoTheBowHunter is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    58
    worked like a dream and not to difficult to set up. THANK YOU pbaldy!!!!

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    NikoTheBowHunter is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    58
    got this question solved. now onto the next.

  10. #10
    NikoTheBowHunter is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    58
    After some more research I figured out I need to change the text box the notes were being displayed in to Rich Text. This now allows it to display more than the 255 characters. But after changing the display box for the notes to Rich Text, the new notes no longer drop down to a new line. Its just a continue line of text with spaces. any ideas for fixing this?

    Here is the current code I am using:

    Private Sub Enter_New_Note_Click()
    Me.[Notes History] = Date & " | " & Me.Text138 & vbCrLf & Me.[Notes History]
    Me.Text138 = Null
    End Sub

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Rich text probably requires HTML tags. Try

    Me.[Notes History] = Date & " | " & Me.Text138 & "<BR>" & Me.[Notes History]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    NikoTheBowHunter is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    58
    As always, spot on pbaldy!!! solved it!!! thanks!

  13. #13
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    No problemo!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 05-24-2017, 07:48 AM
  2. Replies: 2
    Last Post: 03-05-2015, 01:10 PM
  3. Replies: 5
    Last Post: 03-23-2014, 09:01 AM
  4. Creating a repair history for inventory items
    By skiskiacm in forum Database Design
    Replies: 1
    Last Post: 04-23-2013, 07:18 PM
  5. Creating a History
    By mwabbe in forum Access
    Replies: 7
    Last Post: 08-19-2010, 09:16 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