Solved

Form pops up when not supposed to....

Posted on 2000-03-23
3
138 Views
Last Modified: 2013-11-28
Hello,

  I have several forms in my project, three of which are named frmAddProduct, frmEditProduct and frmReview.  These are all MDI child forms.  Under the frmReview and frmEditProduct form, there is a text box which has this code for the keydown event:

Private Sub txtReview_KeyDown(KeyCode As Integer, Shift As Integer)
If Shift = 2 And KeyCode = vbKeyA Then
    Me.txtReview.SelStart = 0
    Me.txtReview.SelLength = Len(Me.txtReview)
End If
End Sub

(the name of the text box on the frmEditProduct form is 'txtDescription')

Which basically just selects all the text in the text box when Ctrl-A is pressed.  When I press Ctrl-A, it selects the text in the box, but then frmAddProduct appears for no reason.  I have the same code in the frmAddProduct for the keydown event for a text box called txtDescription, which works without popping up any extra forms.  Whats going on here?
0
Comment
Question by:ingenito
3 Comments
 
LVL 2

Expert Comment

by:evertd
ID: 2649650
You can look at the keypreview property of you forms. Maybe the value is true.

If this won't work you can set the visible property of each form to true and manually set the visible property
0
 
LVL 32

Accepted Solution

by:
Erick37 earned 100 total points
ID: 2649701
Do you have a shortcut key assigned to Ctrl-A ?
0
 

Author Comment

by:ingenito
ID: 2649720
Erick37 had it right.  Stupid me :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Owning a franchise can be the dream of a lifetime. It provides a chance for economic growth. You can be as successful as you want.  To make your franchise successful, you need to market it successfully. Here are six of the best marketing strategies …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question