Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Jul 2005
    Location
    Lancaster, Delaware, USA
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    OnEnter (Access 2000/ Windows XP)

    Hello All,
    I would like to know if there is any problem with using the OnEnter Event to open a query. I have a form and on this form there is a combobox. This combo boxes source is a table. And once I make a selection and I hit enter I would like it to open up the query. Now the selection in the combo box would be passed off to a query.( The query that the OnEnter event would open.) Usually I do this with a command button. I was just wondering if this is possible using the OnEnter Event. Any help is very much appreciated.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: OnEnter (Access 2000/ Windows XP)

    The On Enter event, perhaps confusingly, has nothing to do with the Enter key. The On Enter event occurs just before the user moves to ("enters") a control. To perform an action when the user has selected an item in the combo box, you can use the After Update event of the combo box. It doesn't matter whether the user selects the item using the mouse or the keyboard. For example:

    Private Sub cboSomething_AfterUpdate()
    DoCmd.OpenQuery "qryTest"
    End Sub

    (Substitute the appropriate names)

  3. #3
    Lounger
    Join Date
    Jul 2005
    Location
    Lancaster, Delaware, USA
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OnEnter (Access 2000/ Windows XP)

    Hans,
    Thanks for clearing that up for me. I do understand the AfterUpdate event. I just wasnt sure about the On Enter event. Thanks again

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: OnEnter (Access 2000/ Windows XP)

    >>I have a form and on this form there is a combobox. <<

    e-i-e-i-o! Sorry, couldn't resist. <img src=/S/smile.gif border=0 alt=smile width=15 height=15> BTW, you can also use the On-Click event. This has the added advantage of firing when you make a selection from the dropdown list, even before you actually tab or in some other way move off the control.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    Lounger
    Join Date
    Jul 2005
    Location
    Lancaster, Delaware, USA
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OnEnter (Access 2000/ Windows XP)

    LOL. Sometimes when I am writing this stuff my mind is somewhere else.

Posting Permissions

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