+ Reply to Thread
Results 1 to 5 of 5

Userform coding to mimic Form Button

  1. #1
    Registered User
    Join Date
    06-16-2009
    Location
    Irvine, CA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Userform coding to mimic Form Button

    More detail than you probably need, just to explain what I want to do:

    Excel 2007 (and earlier I think) has a Form button (it needs to be added to the access bar in 2007) that automatically generates a user form when invoked from within a range, automatically generating the form and navigation and criteria buttons, and the criteria button generates another form for selecting records based on the entered criteria.

    I dont like the look and layout of the form however, and would like to use some combo boxes instead of the generated text boxes, some date pickers etc.

    I would like to create a Userform with the same navigation and criteria functionality but my own form. Is there a way to view/access the code generated by the Form button that I could copy and modify after invoking it from within a table set up with the fields for my form?

    Alternatively is there a resource that has sample userform navigation coding?

    Thanks

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Userform coding to mimic Form Button

    Hello copernicus,

    Welcome to the Forum!

    In Excel 2003 and earlier, the only auto generated form I know about is the "Data Form". This would automatically create a simple database management tool for finding, adding, deleting records. it would create text boxes for each of the fields in the database range. Is this the same form you are referring to?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-16-2009
    Location
    Irvine, CA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Userform coding to mimic Form Button

    Yes. Thats the one. In 2007 "help" they just call it the Form button, but the title of the help section is "what happened to the Data Form?"

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Userform coding to mimic Form Button

    Hello copernicus,

    I can't answer your question with regard to 2007 because I don't own a copy or use it. As for the previous versions you would need to create your own Data Form with a VBA UserForm. You can't customize the Data Form controls. RoyUK, the site administrator, has a nice database manager similar to the data form that uses a VBA UserForm. You could use his a guide for your custom form.

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

    Re: Userform coding to mimic Form Button

    You can't access the code behind the built in data form, take a look at the databaseform example here

    http://www.excel-it.com/vba_examples.htm
    Hope that helps.

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

    Free DataBaseForm example

+ 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