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!

Trouble when I Delete with an OCX

Status
Not open for further replies.

LifeDragon

Programmer
Jul 12, 2005
6
0
0
CA
I have an OCX in an Access 2000 application that does the following code when I click on the Delete button

ParentForm.Application.DoCmd.SetWarnings False
ParentForm.AllowDeletions = True
ParentForm.Application.DoCmd.RunCommand acCmdDeleteRecord
ParentForm.Application.DoCmd.SetWarnings True
ParentFrom.AllowDeletions = False

That part of code works great, but if I delete the last record of a table,
A Message Pops up saying "No Current Data" 2 or 3 times in a row and then it continues like nothing happened, but it is really annoying when the users see it.

As I saw the bug comes from the fact that the form still points to the record, even though it's Deleted

Proof : When I leave my mouse on the Scroll Bar, it says : "Record: 1 of 0"

So, my question is : Is there a way to force the form to see that there isn't anymore record? [ponder]
 
Sadly, even when I put Requery into my OCX I still get the "No current Data" Message
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top