+ Reply to Thread
Results 1 to 2 of 2

UserForm Load Record Function Does Not Load First Record

  1. #1
    Registered User
    Join Date
    05-16-2011
    Location
    Virginia Beach, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    22

    UserForm Load Record Function Does Not Load First Record

    In the UserForm_Initialize() function is set the first record to Rows(2) in the Named Range "DataBase". Then I call the LoadRecord function which should load the values in Rows(2) but it loads the last viewed record. Where am I going wrong? Thanks for your help in advance! Example attached.LESSONS LEARNED DATABASE FORUM SUBMITTAL.xlsm

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: UserForm Load Record Function Does Not Load First Record

    When you click the OK or Cancel buttons, your code just hides the userform. Then when you show it again, the userform is made visible, but its' Initialize procedure is not run again.

    Please Login or Register  to view this content.
    If you want it to re-initialize every time, unload the userform.
    Please Login or Register  to view this content.

    Alternatively, have it reload the row(2) record in the UserForm_Activate procedure.
    Last edited by AlphaFrog; 03-05-2014 at 02:35 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. [SOLVED] Function Key To Load UserForm
    By SheppeyMan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-01-2014, 06:54 PM
  2. [SOLVED] Record Macro function does not record certain commands
    By m185945 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 11-01-2013, 11:02 AM
  3. Add new record to excel userform below the last record
    By Megatronixs in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-27-2013, 02:49 AM
  4. Replies: 1
    Last Post: 11-16-2012, 09:25 AM
  5. Command Buttons for Viewing Record, Next Record and Previous Record
    By david1987 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-23-2012, 06:30 AM

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