When I hit the Enter key on the keyboard I would like it to automatically process. Currently, I will enter the Medicaid_ID, hit Enter (instead of processing it is tabbing to the button. When I hit Enter again it runs the process.) How do I get the process to run by hitting Enter once after entering the Medicaid_ID in the textbox?
Here is my current code:
Private Sub Command3_Click()
Dim MedID As String
' Get Value from Medicaid_ID textbox on the Form:
Me.Command3.SetFocus
Me.Medicaid_ID.SetFocus
MedID = Me.Medicaid_ID.Text
If IsNull(DLookup("NAME", "Master_Facility_List_Table", "Medicaid_ID = '" & MedID & "'")) Then
' NAME is Null because the Medicaid_ID doesn't exist.
DoCmd.OpenForm "INPUT_Data (NewFacility)"
Else
' NAME is not Null because the Medicaid_ID does exist.
DoCmd.OpenForm "INPUT_Data (ExistingFacility)"
End If
End Sub
Thanks.