Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2003
    Posts
    104

    Unanswered: SetFocus gives a weird error

    Note: Yes I DID search the forum for this, but could not find anything that directly relates to this problem!


    Hi All, Please check out the following 2 images that will help illustrate the problem

    What I am trying to do...
    http://shassouneh.homestead.com/files/setfocus.JPG

    the error I am getting...
    http://shassouneh.homestead.com/files/2108.jpg

    The Code In question (highlighted)
    Code:
     If (cmbobxLoginType.Value = "Administrator (password required)") Then 'Admin login. Show the password field
            lblPassword.Visible = True
            lblPasswordNote.Visible = True
            txtbxPassword.Visible = True
            txtbxPassword.SetFocus
        Else 'otherwise regular user login. hide password login...
            
            cmbobxLoginType.SetFocus
            'Me.SetFocus
            lblPassword.Visible = False
            lblPasswordNote.Visible = False
            txtbxPassword.Visible = False
            
        End If
    Please reply if you can help!
    Last edited by shassouneh; 04-26-04 at 18:24.

  2. #2
    Join Date
    Feb 2004
    Posts
    137
    I might be able to shed some light on this if you can tell me one thing. What Sub or Function is this code part of? Is it part of Private Sub cmbobxLoginType_AfterUpdate? Is it part of Private Sub cmbobxLoginType_Exit? What Sub or Function contains this code in your form?

  3. #3
    Join Date
    Nov 2003
    Posts
    104

    neither

    Quote Originally Posted by Matthew Reeves
    I might be able to shed some light on this if you can tell me one thing. What Sub or Function is this code part of? Is it part of Private Sub cmbobxLoginType_AfterUpdate? Is it part of Private Sub cmbobxLoginType_Exit? What Sub or Function contains this code in your form?
    Neither. It is the OnChange

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Is your filed Enabled?

  5. #5
    Join Date
    Nov 2003
    Posts
    104

    yes

    Quote Originally Posted by hammbakka
    Is your filed Enabled?
    Yes. Initially the feild is invisible. BUT, by the time the setFocus call is hit, the feild is both enabled AND visible!

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    But in your code there is nothing about .Enabled=True
    Try to make it enabled initially

  7. #7
    Join Date
    Nov 2003
    Posts
    104
    Quote Originally Posted by hammbakka
    But in your code there is nothing about .Enabled=True
    Try to make it enabled initially
    Please see the attached images in my initial post. The combo box IS enabled and visible!!!


Posting Permissions

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