You can use the Before Update event of the text box to do the lookup, then
use the Where argument of the OpenForm to have the form open to the selected
ID. The reason I perfer the Before Update rather than the After Update is
because it can be canceled and you make the cursor stay in the text box.
Private Sub MyTextBox_BeforeUpdate(Cancel As Integer)
Dim varUser As Variant
If Not IsNull(Me.MyTextBox) Then
varUser = DLookup("ID", "UserTable", "ID = " & Me.MyTextBox)
If IsNull(varUser) Then
MsgBox "User " & Me.MyTextBox & "Not Found", _
vbExclamation + vbOkOnly, "Entry Error"
Me.MyTextBox.Undo
Cancel = True
Else
Docmd.OpenForm "MyOtherForm", , , "ID = " & Me.MyTextBox
End If
End With
End Sub
But, why not use a combo box? That is what they were designed to do.