Press enter in textbox and execute button function in VBA

前端 未结 5 888
春和景丽
春和景丽 2020-12-11 06:23

I have a login form to my database done in Access 2010 and using VBA code. I want to be able to press Enter on txtboxPassword and automatically execu

5条回答
  •  误落风尘
    2020-12-11 07:13

    to activate KeyCode, you need to set Key Preview Property on form to YES (it will be at the bottom)

    If KeyCode = vbKeyReturn Then
        Your_fuction_here
    End If
    

提交回复
热议问题