+ Reply to Thread
Results 1 to 18 of 18

macro code to show userform

  1. #1
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690

    macro code to show userform

    hi guys
    wondered if someone could give me the macro code
    for when i click an image

    that says click me

    it takes me to the input data userform

    thanks

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Once you have attached the control that you want to click, you can assign this macro to it:

    Please Login or Register  to view this content.
    NOTE: userfom1 should be the name of the userform you want to show.

  3. #3
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    hi big bas

    im getting invalid outside procedure

  4. #4
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    maybe its something to with this???

    Public Const conPW As String = "WAREHOUSE"

  5. #5
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Where is the problem? The code that I have given you is strictly to show the actual userform. Attach that code to your control.

    Are you saying there is a problem within your actual code somewhere else? Can you post the entire code that you are using?

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You need to right click on the image & select Assign macro >- New. This will open the VB Editor & you copy & paste Bigbas's code like this.
    Please Login or Register  to view this content.
    Make sure the name of the userform is correct
    Hope that helps.

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

    Free DataBaseForm example

  7. #7
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    got it to work big bas

    what i need the search button to do is :-

    if i type a customer name up ie smith

    i need it to look on the data worksheet for the name smith and then display all the details for that customer

    or indeed the same for job number
    ie 2345

    is this possible

  8. #8
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    It definitely sounds plausible.

    In matters like this, it is most helpful to post a .zip sample of your worksheet so that we know exactly what you are working with. Also, attach clear details on what you would like to happen.

    I know many of us have built database like Excel files with functional search features, so it shouldn't be a problem.

  9. #9
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    what i should add is that my search userform

    has customer name or job number as its search items

    but when it finds its target it needs to display

    customer name
    job number
    size
    material
    qty
    code
    in or out
    date done
    booked out?
    comments
    grey card

    is that possible?

  10. #10
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    i cant attach it bas as its already 255kb

  11. #11
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    when i compress it
    it only goes to 234 is this normal?

  12. #12
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Take a look at the databaseform example here

    http://www.excel-it.com/vba_examples.htm

    It has a search function

  13. #13
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    superb royuk

    many thanks

    exactly what i needed

    will give it a read and a good go

    back later no doubt. . . .

  14. #14
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    HI ROY

    were you the author of that?

    do you mind if i try and adapt it for my stuff as it is awesome

    and do you mind if i ask a few questions along the way so i can try and understand some of the coding

    thanks

  15. #15
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Yes it's my work, from a bout 3 years ago. You can use it in your projects and post here for help.

    I am working on a new version with more features as time permits.
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    superb roy many many thanks

    really appreciated

    im trying to learn macros and vba but its slow learning without anything to compare to so your offer is greatly appreciated

    regards

    steve

  17. #17
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    hi roy

    just wondering what this part actually does

    Please Login or Register  to view this content.

  18. #18
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    roy?
    please

+ 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