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

How to fix the accidental data entry from loading into the table? 2

Status
Not open for further replies.

hu5

Technical User
Apr 9, 2004
28
US
Hi,

I created a form based on this table, the first textbox is for RecordID entry. If user searched for a record, typed over the existing RecordID, closed the form and re-open the form. The record now has a wrong RecordID, and it can not be undone. Is there a fix to this problem?

Is there other way of pulling the record by typing the recordID you are searching for besides using the edit-find menu on the top of the screen? Thanks in advance.
 
Hi!

#1 - The before update event of a form might be used for that. It triggeres whenever a save operation is attempted, and you might cancel it. Simple example:

[tt]private sub form_beforeupdate(Cancel as integer)
if msgbox("Save changes?",vbOkCancel)=vbcancel then
cancel=true
end if
end sub[/tt]

#2 - Use combos. When invoking the wizard, chose the third option "Find a record on my form..."

Roy-Vidar
 
Is your RecordID an autonumber or code you use to create??
If this is the case, in the desing view go to the properties of the RecordID and lock it so no additions, edits can be made to the field.

Also, you can create your own Find button. If necessary, use the wizzard.


HTH

An investment in knowledge always pays the best dividends.
by Benjamin Franklin
Autonumber Description thread 702-5106
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top