+ Reply to Thread
Results 1 to 4 of 4

userforms not opening in order

  1. #1
    Registered User
    Join Date
    10-04-2011
    Location
    Salem, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    60

    userforms not opening in order

    G'evening Everyone,

    I've a simple problem here I'm sure. Attached is small WB and along with this text should demonstrate the problem I'm having.

    Form 1 Shows when WB is opened.

    Using the OptionButton and CommandButtons will take you from Form1 to Form2 and back again to Form1. (for now let's forget about Form3, the same thing happens with it so a solution to the problem will work with Form3 also.)

    Selecting OptionButton1 and hitting CommandButton1 Hides Form1 and Shows Form2. When Form2 opens it displays the next numerical number in Row A in a TextBox window. Clicking the CommandButton places the value of TB in the next cell in Row A, clears the TB window and sends you back to Form1. This all works fine to here.

    Now comes the problem....without closing the WB select OptionButton1 (Form1) again and click the CommandButton.....Form1 Hides and Form2 Shows, however the Textbox now is empty. I'm trying to make that Textbox show the next numerical number in Row A every time Form2 opens.

    Any and all help will be greatly appreicated.....TIA,

    Don
    Attached Files Attached Files
    Last edited by DonG; 12-01-2011 at 12:17 PM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: .........

    Hi DonG

    you need to swap the order of commands around

    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    10-04-2011
    Location
    Salem, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: .........

    Quote Originally Posted by pike View Post
    .......you need to swap the order of commands around......
    Pike,

    As I explained in PM, the code you posted exhibits the same behavior....i.e. The first cycle (Form1 to Form2 operates correctly) When you select Opt1 on Form1 the second time around, Form2 opens but the TB does not populate correctly.

    Don

  4. #4
    Registered User
    Join Date
    10-04-2011
    Location
    Salem, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: userforms not opening in order

    Problem Solved......

    By using the "Unload" rather than the "Hide" code, this makes the forms work exactly as I was after....

    Don

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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