• Memo Field (A2K)

    Author
    Topic
    #443119

    OK…I don’t know if or how this can be accomplished, but I don’t know of a better forum to find out.

    I need to know if a memo field can do the following:

    1. A time stamp and User’s Initials inserted as the user begins to enter data.—Can this be done, and if so, could someone point me in the right direction?

    I’m going to enter “the brown cat ran away”
    i.e. 6/12/07 rlp The brown cat ran away

    2. Once the user is done inputting data and exits the memo field the data that was just put in, can it be locked.–Can this be done, if so, could someone point me in the right direction?

    i.e. 6/12/07 rlp The brown cat ran away is now dimmed

    If I re-enter the memo field, what was previously entered is dimmed, but I can continue to enter another note, and like before, once I’m done, that data is also dimmed.

    Thanks for any suggestions, it’s greatly appreciated.

    Viewing 2 reply threads
    Author
    Replies
    • #1068150

      Hi Roberta

      I have #1 sorted for you, just trying to get #2 done

      Private Sub MemoField_AfterUpdate()
      Me.MemoField = Format(Now(), “MM/DD/YYYY”) & ” ” & Me.MemoField

      End Sub

      Obviously change the name of MemoField to the name of yours

    • #1068153

      Are you going to use this field to enter comments for different days?

      If so, why dont you create another table that contains the ID back to the main table, a date and comment fields, then just introduce a subform to cater for this.

    • #1068155

      I’d go with Patt’s suggestion. You cannot lock or “dim” part of a field, so it’s much better to store the notes in a separate table, with a new note for each new comment. Put a date field in the table with Default Value set to =Date().
      You can lock the notes text box if it’s not empty, in the On Current event of the (sub)form used for entering the notes.
      As to the initials, where do you want to take these from?

      • #1068214

        I think I came up with a resolution and if it works, I will pass it on in case someone else may be looking for it.

        Here are my thoughts.

        1. Bound Memo Field
        A. disabled
        B. Must store the Date/Time, the User’s Initials, and Note # (will us DMAX for this peice)
        C. MUST be visible at all times for everyone to view.

        2. Unbound Memo Field
        A. Enabled
        B. Code to capture the Date/Time, user’s initials, date, and note # prior to user entering data in the the UNBOUND memo field.
        C. Once the user exits the memo field, the data will append to the BOUND memo field.

        Like I said, it’s something I’m currently working on. At this point I’m not even sure it will work.

        ***As for the users initials, I have a table, tblUser. tblUser houses the following:***
        1. Users First and Last Name (2 fields)
        2. Users Initials
        3. Users LoginID (computer Login ID)
        4. Access Level (which uses another table, tblAccessLevel) which is used for many other thingies.

        My thought at this time is to:
        Use the BeforeUpdate event to:
        A. Retrieve the Date/Time
        B. Retrieve the users initials by using DLookUP based on the login id
        C. insert the (in cronilogical order) next Note # by using the DMAX to retrieve the next # in line based on the project #.

        If someone thinks I’m going down a fruitless avenue, please let me know.

        • #1068223

          I think that would work, but do you have a compelling reason for wanting to put all the notes into a memo field in the same record? Conventional database wisdom says that you shouldn’t store multiple and disparate items (date, initials, note text) together.
          If you put each note in a separate record, with separate fields for date, initials and note text, it becomes very easy to sort or select notes by date or by username. With everything dumped into one field in one record, you’re stuck with a fixed format which will become unwieldy over time.

          • #1068255

            I don’t disagree with using the memo field for storage. What about this approach?

            New table with:
            1. Date/Time
            2. User Initials
            3. Note #
            4. Memo field
            5. ProjectNo

            Using the UNBOUND memo field, I could then append this data to the newTable on Exit. Leaving the memo field enabled/unlocked.

            As you and Patt suggested, use a subform to link the records to the main form and disable/lock these records. Thus, still allowing the user to input another note (UNBOUND memo field) for the projectno and storing and locking the the “notes” records correctly.

            Doable?

            • #1068268

              You don’t need an unbound memo field. The user can directly enter a note into the bound field. Use code in the On Current event of the subform to lock / unlock the notes field depending on whether it is filled:

              Private Sub Form_Current()
              Me.Notes.Locked = Not IsNull(Me.Notes)
              End Sub

    Viewing 2 reply threads
    Reply To: Memo Field (A2K)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: