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

delete record problem in a form

Status
Not open for further replies.
Jun 9, 1999
45
HK
I got 3 records in a table and I have a form where the source is based on
this table. Now I created a delete button from toolbox wizard and it should
delete the current record. If I press that button, the current record on
the form is empty out instead of deleted. After deletion and refresh, there are 3 records and 1 is all empty. How can I make it deleting a record instead of empty out the record? I am running access 97. Please help. Thanks.
 
How are ya supernova122 . . .

At the end of the code in the button, add the following line:
Code:
[blue]   Me.Requery[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
I added me.requery at the end of code. After I press the delete button, the empty record is shown in the form and when I try to go to previous record, it gives me a msg window as following:
Update or CancalUpdate without AddNew or Edit.
After I click the OK button, it stayed in the same form and I am stucked. Please help. Thanks.
 
I figured out this problem only happens when I delete the last record. Any
help? Thanks.
 
I have worked around the problem. By adding the following code to load form event:

Me.AllowAdditions = False

and set it to right for unload form event. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top