Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

make unbound text box active again

Status
Not open for further replies.

asinarrgh

Programmer
Apr 2, 2003
9
SK
I have a form for viewing part information
Part#, Serial#, Location, etc.
On the top of the form I have three unbound text boxes labeled txtFindPart, txtFindSer and txtFindLoc.
I have listed the code in the "After Update" event at the bottom of this question.

My problem is when the partno is NOT found, focus DOES NOT return to the txtFindPart as I expect; instead it returns to the textbox AFTER the txtFindPart text box. How do I get it to return to the txtFindPart text box?

Each of the unbound text boxes exhibit the same behaviour - they return to the FOLLOWING text box.

Thank you
------------------
Private Sub txtFindPart_AfterUpdate()
Dim varBookmark As Variant

varBookmark = Me.Bookmark
Me.RecordsetClone.FindFirst "[PartNo] = '" & Me![txtFindPart] & "'"
If Me.RecordsetClone.NoMatch Then
MsgBox "Could not find that part number... please retry"
Me.Bookmark = varBookmark
Me.txtFindPart.SetFocus
Else
Me.Bookmark = Me.RecordsetClone.Bookmark
Me!txtFindPart = Null
End If
End Sub
-----------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top