+ Reply to Thread
Results 1 to 8 of 8

help with user form and combo box

  1. #1
    Forum Contributor TechRetard's Avatar
    Join Date
    06-14-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    202

    help with user form and combo box

    Ok, I am beginning a project to add the option to edit/add data through a user form.

    My first two problems are:
    (1) when the form comes up the combo box isn't populated...I can hit a button (in my case the Cancel Button) to initialize the form, but how so i make it so it is initialized when it initially shows
    (2) when I select the title from the combo box, only 1 text box is populating

    Thanks for lookin at this with me
    Attached Files Attached Files
    Last edited by TechRetard; 01-31-2011 at 07:24 PM.

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

    Re: help with user form and combo box

    For a start, you haven't used the correct procedures for the form. In the VB Editor select the form & use the right hand drop down to select the procedures
    Hope that helps.

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

    Free DataBaseForm example

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

    Re: help with user form and combo box

    Try replacing your code with this, not sure why you jave most of that code
    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Contributor TechRetard's Avatar
    Join Date
    06-14-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: help with user form and combo box

    Quote Originally Posted by royUK View Post
    not sure why you jave most of that code
    story of my life


    Thanks I'll give that a whirl

    And thanks for the heads up on the procedures ---

    Now im going to try to make it learn whether to update or add...might see me in a few hours

    (vba is new to me, i'm used to C#.net..same thought process diff syntax)
    Last edited by TechRetard; 01-31-2011 at 03:52 PM.

  5. #5
    Forum Contributor TechRetard's Avatar
    Join Date
    06-14-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: help with user form and combo box

    I think I got it....

    Please Login or Register  to view this content.

  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: help with user form and combo box

    So what's wrong with the code that i posted? It posts to the next empty row much more efficiently than your code

  7. #7
    Forum Contributor TechRetard's Avatar
    Join Date
    06-14-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: help with user form and combo box

    Quote Originally Posted by royUK View Post
    much more efficiently than your code
    ...that is your code

    The code in the middle that I added updates the record if it already exists

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

    Re: help with user form and combo box

    If you want to include amending data in the OK button, use the ListIndex to get the Row, avoiding looping
    Please Login or Register  to view this content.

+ 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