+ Reply to Thread
Results 1 to 6 of 6

using combo box selection to change another's rowsource

  1. #1
    Registered User
    Join Date
    05-31-2011
    Location
    Belgium
    MS-Off Ver
    Excel 2007
    Posts
    8

    using combo box selection to change another's rowsource

    Hey,

    I've encountered an issue with code for getting a userform to react dynamically to user input in combo boxes.

    I have three combo boxes (Featured Post Area Category, Featured Post Category 1, Featured Post Category 2) whose contents I would like determined by the user selection on the drop down menu of another combo box on the userform, 'Select Business'.

    I've attached the workbook...

    I've tried to create the right code with, but I don't have the requisite skills yet to make it work yet.

    Thanks in advance for any support, much appreciated

    John
    Attached Files Attached Files

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: using combo box selection to change another's rowsource

    John,

    This is your current code. I'm not entirely sure what you want to do here:
    Please Login or Register  to view this content.


    So I took the first select case statement and adjusted it so that it will update the combobox "featuredpostareacategory" rowsource:
    Please Login or Register  to view this content.


    Is something like that what you're looking for?

    ~tigeravatar

  3. #3
    Registered User
    Join Date
    05-31-2011
    Location
    Belgium
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: using combo box selection to change another's rowsource

    Hey,

    thanks for the code, that seems to have worked for the most part... Although I have encountered a different problem now.

    I have adapted your code so that it works for all three combo boxes now; they all now change their content depending on the option chosen in a previous combo box.

    Now when I use the userform, when I hit 'Add', I receive the following error:-

    Compile error: method or data member not found

    I have attached a sample workbook. Any ideas how to fix this?

    John
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: using combo box selection to change another's rowsource

    This is a continuation of your previous post

    This name is missing, probably a misspelling

    SelectBlogDrpDwn

    I suggest you read up on VBA a little, Debug highlights the error & using Option Explicit helps avoid these type of errors

    Writing Code Introduction
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    05-31-2011
    Location
    Belgium
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: using combo box selection to change another's rowsource

    Hi Roy,

    Thanks again for your assistance, and I take your point on reading up about VBA which I will... I have learnt a fair amount on the fly aswell, but i'll be sure to cover the basics - thanks for the link

    I see now your reference to the highlighting of the text when the ''Compile error'' pops up, I had renamed the combo box without consideration of the code, school boy error...

    So I have gone through and corrected the mis-spellings and a new Compile error has popped up, one that I can't fix with my recent understanding of the highlighting of the error...

    Its: ''Compile error: only comments may appear after End Sub, End Function, Or End Property''

    I've attached another copy of the worksheet

    Any help is again greatly appreciated.

    Cheers,

    John
    Attached Files Attached Files

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: using combo box selection to change another's rowsource

    That means that you have code outside of Sub "blah() & End Sub.

    Option Exlpicit should be at the top of the code window before any code , not between code

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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