+ Reply to Thread
Results 1 to 9 of 9

Fill textbox in each active UserForm

  1. #1
    Registered User
    Join Date
    06-07-2013
    Location
    Warsaw
    MS-Off Ver
    Excel 2007
    Posts
    19

    Fill textbox in each active UserForm

    Dears,

    I have a problem with my VBA code.

    I have over 20 Userform which have one textbox with the same name txtsejobcode1.

    Additional I have a UserForm in which user can search for a needed job code.

    I wanted that after a user will choose a job code the job code will be added in to the active userform with the textbox named txtsejobcode1.

    I could build this:

    Please Login or Register  to view this content.
    But in the line with Combobox I'm getting a error 438

    Run Time error 438
    Object doesn't support this property or method.

    Please help

    PS. Sorry for my english

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644
    Isn't K the userform object?

    If it is you should be using it in the loop when trying to refer to the textbox.

    PS Why do you have all these userforms open at the same time?

    Also, are the userforms identical?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    06-07-2013
    Location
    Warsaw
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Fill textbox in each active UserForm

    Hi,
    k = textbox - txtsejobcode1
    No, my program run like this:

    User opens one from 20 userforms which have textbox "txtsejobcode1". In this form he has a button which runs the userfrom in which he can search for a job code.
    After he choose the job code the value should be copied in to the active userform in to the textbox "txtsejobcode1".

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644
    Why the loop then?

  5. #5
    Registered User
    Join Date
    06-07-2013
    Location
    Warsaw
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Fill textbox in each active UserForm

    Because I have 20 userforms with the textbox txtsejobcode1 but only one userform to search for a job code which can be run in each of the 20 userforms thru a button

    Thats why I want that the choosen job code will be copied in to the active userform.

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

    Why do you have 20 userforms?

    Are they all the same?

  7. #7
    Registered User
    Join Date
    06-07-2013
    Location
    Warsaw
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Fill textbox in each active UserForm

    Hi,

    I have created a program to create contracts.

    In my program I have created over 20 userform which are filled with fields, comboboxes which need to be provided by the user to create a contract for some employee.

    Each userform represents different contract.

    Each userform has one the same field textbox txtsejobcode1 which is needed in all contracts.

    In each of the Userform I have a button which is initializing a user form which has a search engine to search for a job code.
    I want that choosen job code will be added in to the textbox in the active userform from which the button to search for a job code was clicked.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644
    Can't you have the code to search for the job code in the individual userforms?

    Or perhaps in a separate sub that each userform can call.

  9. #9
    Registered User
    Join Date
    06-07-2013
    Location
    Warsaw
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Fill textbox in each active UserForm

    Separate sub

    Please Login or Register  to view this content.
    Last edited by Laik2013; 02-22-2014 at 05:15 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Userform textbox to reference active cell with offset
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 6
    Last Post: 12-15-2013, 01:38 AM
  2. [SOLVED] Use combobox to fill textbox within userform
    By Orestees in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-26-2012, 03:39 PM
  3. [SOLVED] VBA UserForm - Have entry in TextBox fill Another TextBox by VLOOKUP
    By msquared99 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-26-2012, 10:24 PM
  4. Conditional TextBox Fill On UserForm
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2011, 12:19 PM
  5. fill a listbox from textbox of other tab of userform in excel vba
    By kmlprtsngh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-22-2010, 03:36 AM

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