Results 1 to 1 of 1

Thread: Prev Button and Transfering Form Code

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2008
    Posts
    161

    Prev Button and Transfering Form Code

    I have attached a spreadsheet which contains two Forms, userQuestions and userDocform. At Present when You Run the userQuestions form and answer question 2 as Yes. You will view the document copy. The problem is this, When you Click On Cancel on this form it actually moves to the next question in the list. I actually need it to Revert to the Prev Question. i.e Same Functionality as the Prev button on the userQuestions form.

    I'm wondering how to do this? Would I need to re-declare all the variables as public and approach it that way, or maybe a macro would suffice?

    I've attached the Code to the current version of the Prev Button As below.

    Code:
    If m_QID = 1 Then
            m_QID = 1
            CmdPrevQuestion.Enabled = False
        Else
     
            m_QID = QID_Prev(m_Question)
    
      Call Delete_LastRow
            Call Question_load
            
            CmdPrevQuestion.Enabled = True
        End If
    
    Function Delete_LastRow()
    Application.ScreenUpdating = False
    Dim LastRow As Long
    LastRow = Sheets("output").Range("A" & Rows.Count).End(xlUp).row
    Sheets("output").Rows(LastRow).Delete
    Application.ScreenUpdating = True
    End Function
    Attached Files Attached Files

Posting Permissions

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



Click Here to Expand Forum to Full Width