+ Reply to Thread
Results 1 to 10 of 10

Spin Down Event skipping one record

  1. #1
    Registered User
    Join Date
    07-31-2014
    Location
    Ephrata, PA
    MS-Off Ver
    2007
    Posts
    7

    Spin Down Event skipping one record

    I am creating a VBA userform and using a table as a database. I have a spin button created with both SpinDown and SpinUp Subs that allow me to scroll through the database records. When the form initializes, it shows the most recently added transaction on file. When pressing the SpinDown button, one record is skipped, i.e. if the last record is 100 and SpinDown is pressed 98 shows, not 99. Continuing to SpinUp or SpinDown and 99 will show, just not on the first SpinDown event. Other than this, the spin button works fine. Same exact scenario when a new record is added.

    Does anyone have any general ideas of what might be wrong? I know I can post the code and someone can help, but I'm trying to figure this out on my own, maybe with a few clues.

    If need be I will post my code.

    Thank you in advance for your help.

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

    Re: Spin Down Event skipping one record

    Can you determine if the Sub is triggered twice or is it moving two records for one execution?

    Post the code please.
    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.

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

    Re: Spin Down Event skipping one record

    Can you determine if the Sub is triggered twice or is it moving two records for one execution?

    Are there any other event procedures for the SpinButton other than the SpinUp and SpinDown procedures?

    Post the code please.

  4. #4
    Registered User
    Join Date
    07-31-2014
    Location
    Ephrata, PA
    MS-Off Ver
    2007
    Posts
    7

    Re: Spin Down Event skipping one record

    Code attached. Thanks.

    Please Login or Register  to view this content.

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

    Re: Spin Down Event skipping one record

    Check that the SmallChange property for SpinButton1 is set to 1 and not 2.

  6. #6
    Registered User
    Join Date
    07-31-2014
    Location
    Ephrata, PA
    MS-Off Ver
    2007
    Posts
    7

    Re: Spin Down Event skipping one record

    Yes it is.

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

    Re: Spin Down Event skipping one record

    Can you attach your workbook file?

  8. #8
    Registered User
    Join Date
    07-31-2014
    Location
    Ephrata, PA
    MS-Off Ver
    2007
    Posts
    7

    Re: Spin Down Event skipping one record

    Workbook attached.
    Attached Files Attached Files

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

    Re: Spin Down Event skipping one record

    Your workbook functions as expected for me. The spinbutton shifts one record at a time.

    I'm wondering if your mouse is somehow double clicking or sending clicks too fast.

    As a test: with the spinbutton control active, use the keyboard up\down arrows to change records. Does that make a difference?

    Another test: increase the spinbutton .Delay property to say 200 or more. Does that make a difference?

  10. #10
    Registered User
    Join Date
    07-31-2014
    Location
    Ephrata, PA
    MS-Off Ver
    2007
    Posts
    7

    Re: Spin Down Event skipping one record

    I pushed the delay up to 5,000. I also tried using the keyboard vs. the mouse. Still opens to record 7, and when spin down is pressed or selected jumps to record 5. If spin up is selected next, it does go to record 6. Weird. I'm going to try it on another computer. Thanks.

+ 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. Spin button event handling
    By d3hartm2 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-17-2014, 05:29 PM
  2. Auto sort macro for spin button event
    By mantooth29 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-05-2011, 02:58 PM
  3. Record Time & Date of Event
    By R_S_6 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-18-2009, 07:27 PM
  4. Spin Button Event Change
    By sepandb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2008, 04:00 PM
  5. Spin Button:spin cells A7
    By ice in forum Excel General
    Replies: 1
    Last Post: 03-16-2007, 02:23 PM

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