+ Reply to Thread
Results 1 to 4 of 4

Retaining focus on non-modal form

  1. #1
    Registered User
    Join Date
    10-25-2006
    Posts
    54

    Retaining focus on non-modal form

    Folks

    This is a strange one.

    I have a form that has to be non-modal as there is a "contact" command button that generates another non-modal form with contact details.

    The main list box on the form is loaded with a range of cells on an underlying worksheet.

    Everything seems to run ok but then the form flashes on the screen for a second (or less) and then disappears.

    When the form is modal it works fine ie showmodal=true.

    Here's the code; I think what I am after is some way to set the focus on the form as I assume that something else is grabbing the focus but I don't understand what.

    Any ideas? Thanks

    by_exp_date is just a function that queries and collects the underlying data in the workbook onto the TEMP tab.

    frm_customlists is the form being loaded with the data

    frm_switchcustom is the switchboard from where the code is run.

    Please Login or Register  to view this content.
    Regards

    Andy

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why not use one UserForm with a MultiPage Control?
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-25-2006
    Posts
    54
    Thanks Roy, it's a good thought and I had been playing with the idea of making all the info appear on one form. There is another problem though which is that the person who's using these would need to flip between different workbooks as part of her job. This application could easily stand alone as it is which would allow me to leave the forms modal but, the rest of her job would need her to access other books in Excel.

    Thanks again though.

    A

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You don't need to flip through books, just refer to the books in your code, see

    http://www.excelforum.com/showthread.php?t=627076

+ 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