+ Reply to Thread
Results 1 to 3 of 3

Trapping Form Events

  1. #1
    Registered User
    Join Date
    01-19-2007
    Posts
    24

    Trapping Form Events

    Anyone have any idea why this doesn't work?
    I have a text box on the form and I type into it. By my understanding, this event should fire. KeyPress and KeyUp also don't fire.
    I don't get anything. No error, no message box...nothing.

    Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)

    MsgBox Me.ActiveControl.Name

    End Sub

  2. #2
    Forum Contributor
    Join Date
    09-28-2006
    Posts
    122

    try this

    its possibly because your event is related to the form rather than the textbox,

    I had a similar problem a while back, and in the end decided that what i actually wanted was the event to trigger after the textbox entry had been completed and the user had moved onto the next textbox, so i put my event here

    Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    and my event fired at the correct time and did what i wanted (i needed to check the data entered did not already exist on the worksheet being accessed by the textbox)

    let me know if this helps
    Last edited by peejay; 02-12-2007 at 04:31 PM.

  3. #3
    Registered User
    Join Date
    01-19-2007
    Posts
    24
    Nope. I have 120 text boxes that all update different rows on the sheet. I need to trap the event in the form so I can check what text box has been updated.

    I need this to work.

    Thanks anyway.

+ 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