+ Reply to Thread
Results 1 to 10 of 10

Creating an Event Log on a userform

  1. #1
    Registered User
    Join Date
    04-03-2015
    Location
    Limerick, Ireland
    MS-Off Ver
    2010
    Posts
    31

    Creating an Event Log on a userform

    Hi guys, so with my program there are 3 userforms available for the User to enter in a Batch Number value to a text box, e.g: EntryForm1, EntryForm2, EntryForm3. And 1 userform called HomeForm where I would like to create an Event Log screen or textbox that will show the recent Batch Numbers that have been entered via any of the EntryForms.

    For example if Batch Number "0E1234" was entered into textbox on EntryForm1 and the Enter button is clicked, then on the top of the list on the Events Log it will appear - "Batch number 0E1234 has moved to the Production Office."
    Then for example if Batch Number "1E9876" was entered into textbox on EntryForm2 and the Enter button is clicked, then on the top of the list on the Events Log it will appear - "Batch number 1E9876 has moved to the QA Office."
    And then for example if Batch Number "5E5555" was entered into textbox on EntryForm3 and the Enter button is clicked, then on the top of the list on the Events Log it will appear - "Batch number 5E5555 has moved to the QP Office."

    The events log only has to show approximately 10 of the most recent movements on the program.

    If any one out there has any ideas if this type of function is possible to achieve in VBA, many many thanks in advance.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Creating an Event Log on a userform

    Hello Quilie19,

    It would make things easier if you could post a copy of the workbook.

    Please redact any sensitive or confidential information before you post the workbook.
    How To Post Your Workbook
    1. At the bottom right of the Reply window, Click the button Go Advanced
    2. At the top of the Your Message Window, in the first row of icons, Click the Paperclip icon.
    3. Click the Add Files button at the top right in the dialog box. This displays the File Manager dialog.
    4. Click the Select Files button at the bottom middle of the dialog.
    5. In the new window Find the file you want to upload, select it, and Click Open.
    6. You will now be back in the File Manager dialog. Click the bottom Middle button Upload File.
    7. Wait until the file has completely uploaded before you exit the File Manager dialog.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Creating an Event Log on a userform

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Registered User
    Join Date
    04-03-2015
    Location
    Limerick, Ireland
    MS-Off Ver
    2010
    Posts
    31

    Re: Creating an Event Log on a userform

    Cool thanks very much, I have attached my file. If you have any questions about it, don't hesitate to ask.
    Attached Files Attached Files

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Creating an Event Log on a userform

    Hello Quilie19,

    Once these entries have been made to the " Event Log", do they need to be retained when the "HomePage" user form is closed?

  6. #6
    Registered User
    Join Date
    04-03-2015
    Location
    Limerick, Ireland
    MS-Off Ver
    2010
    Posts
    31

    Re: Creating an Event Log on a userform

    Leith, Yes to expand more on what will happen- In any of the Entry userforms, once the user has filled in the text boxes and clicks the Assign Batch Record button, the Batch Record Number will be saved in an appropriate spreadsheet in the workbook, also upon clicking this button the Event Log will be updated on the Homepage, and will be saved there until 10 new events occur of a user clicking the Assign Batch Record button on any of the 4 Entry userforms.

    So yes they do need to be retained on the HomePage userform until it is moved down the list of most recent event and disappears from the screen.
    And they will already be retained in spreadsheets using code in the Assign Batch Record button.

  7. #7
    Registered User
    Join Date
    04-03-2015
    Location
    Limerick, Ireland
    MS-Off Ver
    2010
    Posts
    31

    Re: Creating an Event Log on a userform

    Hi mehmetcik, thank you very much, your code works perfectly. Do you know of any method of saving that information on the userform? So when the user goes off the screen and back to it again it will still be there, and if the user adds more batch numbers they will be just updated.

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Creating an Event Log on a userform

    Save the top 20 lines of the listbox onto a seperate worksheet whenever it is updated
    Then Save the worksheet.

    When the user form is initialised, read the list from the worksheet.


    Or

    Read set the row source of the listbox to a separate worksheet

    and just insert a line to that work sheet and save

    Then refresh the Listbox.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 04-05-2015 at 09:48 AM.

  9. #9
    Registered User
    Join Date
    04-03-2015
    Location
    Limerick, Ireland
    MS-Off Ver
    2010
    Posts
    31

    Re: Creating an Event Log on a userform

    Mehmetcik, I got your code to work to my liking, thank you very much for that much appreciated.

    I have one more question about how to get a Button on a spreadsheet to click and run its code, after the user clicks a button on the userform?

  10. #10
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Creating an Event Log on a userform

    just run its code.

    Please Login or Register  to view this content.
    Will look and behave as if you clicked on command button 1

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. UserForm Change Event
    By PDBartlett in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-10-2014, 12:22 PM
  2. Creating dynamic userform based on several file names and creating chart overlays
    By Thorn23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-18-2014, 12:09 PM
  3. [SOLVED] Userform multipage control - exit event not firing or event order
    By jane serky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-14-2013, 10:23 AM
  4. [SOLVED] Creating An Event Procedure
    By Les Stout in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-04-2005, 09:05 AM
  5. [SOLVED] keypress event on a userform
    By Peter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2005, 03:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1