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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab Stop=yes Causes Skip To Next Record - Weird?!

Status
Not open for further replies.

StarScream

Technical User
Oct 10, 2001
46
0
0
US
I have a Unbound Text Box on a form that a user can type in a message and when they hit enter, the message is transferred to a Bound Text Box that adds Date/Time/User stamp and displays the whole thing.

However, every time I input text twice (basically hit enter twice), it automatically jumps to the next record.

Code:
Private Sub Text0_LostFocus()
Me![DateTimeStamp] = Now()
Me![Note] = Me![Note] & vbCrLf & vbCrLf & Text0 & "  [" & Environ$("username") & " -- " & Me![DateTimeStamp] & "]"
Me![Text0] = ""
Me![Note].Requery
Me![Text0].SetFocus
End Sub

What I wanted was to create an Events Log. I wanted every time someone typed anything into the unbound box, that would create a new record. Instead, it keeps updating the same record -- not what I wanted, but it achieves the same effect.

Can anyone explain or help me turn off the Enter Twice Phenomena ? It seems to result from playing with the Tab Stop: Yes/No. When I set it to Yes, I lose the focus on the unbound text box (it highlights all the text in the bound text box). When I set it to No, the focus stays in the unbound text box, but it keeps skipping to the next record after every two entries.

Help!
 
You may try to replace this:
Me![Text0].SetFocus
with this:
Me![Note].SetFocus
Me![Text0].SetFocus

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,

Thanks! I just saw that I needed to change the focus and then set it back -- but now that prevents me from clicking on the Bounded Text Box.

Instead I'm trying a button -- so when a person types something in the unbound box, they press a "submit" button and it does everything. Works for now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top