+ Reply to Thread
Results 1 to 6 of 6

Userform controls behaviour when moving from one control to another

Hybrid View

muneebmansoor Userform controls behaviour... 02-27-2013, 11:35 AM
Norie Re: Userform controls... 02-27-2013, 11:48 AM
muneebmansoor Re: Userform controls... 02-27-2013, 11:51 AM
Norie Re: Userform controls... 02-27-2013, 11:52 AM
muneebmansoor Re: Userform controls... 02-27-2013, 11:55 AM
Norie Re: Userform controls... 02-27-2013, 12:04 PM
  1. #1
    Registered User
    Join Date
    09-06-2012
    Location
    Redwood City, California
    MS-Off Ver
    Excel 2010
    Posts
    11

    Userform controls behaviour when moving from one control to another

    Good morning Everyone!

    I have built a quoting tool and Userforms to act as a user interface to this tool. The userforms basically just feed user input back to relevant sheets. I have a number of textboxes, listboxes and radio buttons on multipages. Now the issue is that each control has an Afterupdate or Change event associated with it. Consider this scenario:

    I have 4 product categories (represented by radio buttons) : Cat A, Cat B, Cat C, Cat D

    Each category can have up to 10 line items which are represented by combo boxes.

    Now lets say the user has selected Cat A radio button, he selects a product from the combo box (the cursor or focus is still on the combo box) and clicks on Cat B radio button. Here is the issue: on the first click, Afterupdate or Change event of Combo box fires but radio button is still unselected. The user has to click Cat B radio button AGAIN to select Cat B radio button. So essentially it takes two clicks with a slight pause between them to change categories.


    One way to avoid this is to press Enter or 'tab through' each field. But this is not very intuitive. I have tried using Exit, Afterupdate, Exit, Change events without success. I can't use ControlSource option because the cell to input info to is dynamically selected. I have used xlCalculationManual for some text boxes but can't use this since some inputs on the userforms depend on the right value being calculated on the sheet.

    I would be really grateful if anyone can suggest a workaround to this issue.

    Thank you.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Userform controls behaviour when moving from one control to another

    Have you tried stepping through the code to see what's happening (or not happening in this case)?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    09-06-2012
    Location
    Redwood City, California
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Userform controls behaviour when moving from one control to another

    The code works alright. As in it does what its supposed to do; it just doesn't transfer the focus on first click.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Userform controls behaviour when moving from one control to another

    So there's no problem then?

  5. #5
    Registered User
    Join Date
    09-06-2012
    Location
    Redwood City, California
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Userform controls behaviour when moving from one control to another

    The code itself doesn't have a problem per se. Its just that users get irritated that they have to click twice on the radio buttons to select them. So I'm guessing it has something to do with events.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Userform controls behaviour when moving from one control to another

    If you want to find out why this is happening then you should step through the code with F8 to see what's actually happening.

    Perhaps stick a few breakpoints (F9) at relevant points, eg the code that populates the listbox.

    You could always attach a sample workbook if you want someone else to take a look.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

+ 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