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

Prevent changing records while editing?

Status
Not open for further replies.

gtroiano

Technical User
Nov 7, 2001
99
US
i have a data entry form with a sub form (single form view) based on a table. on the form i have buttons to add, save, cancel and delete records. i already have it so the navigation buttons are disabled when in "edit" mode but the user can still change records (i.e. page up/page down, mouse wheel and tabbing through to the next record). i am looking to be able to prevent all of the this and, i guess, lock the sub form to the current record until either "cancel" or "save" is clicked. any help would be appreciated.

jerry.
 
Set the property Display Scroll ... to NO ...

Open the form to the desirer record ... and the person won't be able to change will be stuck only at this record ...


Try this
Vince
 
are you refering to the "Scroll Bar" property on the format tab? if so, it doesn't prevent the user from switch records. if not, then i am stupid and require more guidance.

jerry.
 
Try this code to disable key actions where needed.
Private Sub Extension_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
' If user presses TAB, ENTER, PAGE UP, PAGE DOWN
Case 13, 9, 33, 34
' Disable the keystroke by setting it to 0
KeyCode = 0
Case Else
Debug.Print KeyCode, Shift
End Select
End Sub


 
thanks. that code works but now i need to figure out how to lock the sub form when "Edit" is clicked and unlock it only when "Save" or "Cancel" is clicked. Any ideas.

jerry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top