Results 1 to 4 of 4

Thread: [RESOLVED] Loading form

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Location
    Rafaela (Argentine)
    Posts
    107

    Resolved [RESOLVED] Loading form

    As a consequence of certain event, I have to load a form. But, if that form is already opened, I have to set the focus on it. How can I do this?

    Thanks in advance!!!!
    Last edited by JMuller; Nov 19th, 2007 at 12:52 PM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Loading form

    The easy way
    Code:
    Private Sub Command2_Click()
    Form2.SetFocus
    End Sub

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Location
    Rafaela (Argentine)
    Posts
    107

    Re: Loading form

    Ok, you are right. But I've missed some information in my post. The form I have to call is a clonation from a standard form, so I have to determine if a form with certain data is loaded, and then decide what to do. Could you help me please?

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Loading form

    To determine if it is loaded
    Code:
    Dim f As Form 
    For Each f In Forms 
    If f.Name = "Form1" Then MsgBox "Form1 already loaded" 
    Next
    Replace the msgbox with the setfocus.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width