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

Stopping a form from advancing to the next record 2

Status
Not open for further replies.

PreacherUK

Technical User
Sep 26, 2002
156
NL
Hi chaps (and chapettes :) )

Heres the deal,
(all this exists within a legacy db that I really want to decomission but as yet have to maintain)

I have a form, within that form is a sub form. That subform allows people to change data in a records fields. I plan on taking a snapshot of that record before any changes are made. I thought I'd lock the form (edits/additions/deletes disabled) until a button is pressed, this along with enabling the disabled options would also append the current data in the fields on the form to a table, as a 'pre-change' history record. When the user is happy with their changes they hit another button that 'commits' the data changes to the record and copies the record inot the change history table as the end result of changes by that user.

My problem here is that I want to stop a user from hitting return to the point that they reach the end of a record and progresses to the next. I've tried creating a button/other control on the form and having it as the next tab stop but a quick tab/cursor key press from that control effectivly moves to the next record.

Is there a way to stop this?

When I have placed code in the on exit/lost focus events of the last control in my tab stops list I get an error about:

The expression On Lost Focus you entered as the event property setting produced the following error: A problem occourred while [my database name] was communicating with the ole server or activeX control.

*The expression may not result in the name of a macro, the name of a user-defined function, or [event procedure].
*The may have been an error evaluating the function, event, or macro.


I may be a bit out of touch with access but this all seems like its being very petty :)

Of course if there is a much better way of doing this that someone has, then please, let me know :)

Many thanks for any help.
 
Tools, Options, Keyboard, Move after Enter.

Cursor stops at first or last field.
 
That half works, stops someone hitting the return key. Good stuff, I didn't know about that :)

However, using the cursor keys I can still advance to the next and previous records.
 
Take a look at the Cycle property of the form.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
That was just what I was looking for PH.

A star for you both for sparing me your time and knowledge.

Many Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top