PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
[RESOLVED] vatz error with this........-VBForums
Results 1 to 6 of 6

Thread: [RESOLVED] vatz error with this........

  1. #1

    Thread Starter
    Lively Member preethi_rjs's Avatar
    Join Date
    Dec 2006
    Posts
    80

    Resolved [RESOLVED] vatz error with this........

    VB Code:
    1. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    2. If KeyCode = vbKeyF2 Then
    3. Select Case Me.ActiveControl
    4. Case m1
    5. Form20.Show
    6. Case Text5
    7. Form9.Show
    8. End Select
    9. End If
    10. End Sub

    hi,
    in Text5 if i press F2 Form20 gets loaded and in m1 if i press F2 Form20 gets loaded.
    but in Text5 if i enter a number and then press F2 Form9 gets loaded.

    Why is it so?
    Preethi.

  2. #2
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: vatz error with this........

    Try using the keyUp Event for each controls. Don't use Me.Activecontrol.

    VB Code:
    1. Private Sub Text5_KeyUp(KeyCode As Integer, Shift As Integer)
    2. If KeyCode = vbKeyF2 Then
    3.     Form9.Show
    4. End If
    5. End Sub

  3. #3
    Frenzied Member
    Join Date
    Aug 2005
    Posts
    1,042

    Re: vatz error with this........

    I don't know what m1 is, but the default property of Text5 would be "text" i.2. whatever is entered into Text5.
    Case Text5 won't execute when it is empty. When you add a number to Text5 the value of the property Text causes Case Text5 to execute.

  4. #4

    Thread Starter
    Lively Member preethi_rjs's Avatar
    Join Date
    Dec 2006
    Posts
    80

    Lightbulb Re: vatz error with this........

    YAH, GOT IT WORKING.

    But y, Select case shows such form loading mistakes??


    {Both are textboxes}
    Preethi.

  5. #5
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: vatz error with this........

    It won't work if text5 is empty otherwise it will. I'm glad you figured it out by yourself.

  6. #6
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    Re: vatz error with this........

    do it like th is

    VB Code:
    1. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    2. If KeyCode = vbKeyF2 Then
    3. Select Case Me.ActiveControl.Name
    4. Case "m1"
    5. Form20.Show
    6. Case "Text5"
    7. Form9.Show
    8. End Select
    9. End If
    10. End Sub


    or write separate code for m1 and Text5 control's KeyUp event

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width