[AccessD] A97 Strange Delete Behavior

Charlotte Foust cfoust at infostatsystems.com
Tue May 20 09:52:51 CDT 2003


I haven't taken the time to figure out exactly what those two archaic
lines say, but I can tell you what's happening.  You're deleting the
table rather than the record.  If you want to delete a record, just use
this:
 
DoCmd.RunCommand acCmdDeleteRecord
 
First, you will want to set the focus back to a data control just to
keep Access from getting confused.
 
Charlotte Foust

	-----Original Message-----
	From: Judy Johnson [mailto:jjwrite at earthlink.net] 
	Sent: Tuesday, May 20, 2003 3:39 AM
	To: AccessD
	Subject: [AccessD] A97 Strange Delete Behavior
	
	

	
	I'm having a very strange thing occur. Not sure what's going on.
	 
	My application consists of a FE and BE. I'm linking properly and
my tables are being updated as expected. However; I added a Delete
button to a data entry form and used the Wizard - Delete Record.
	 
	When I launch the delete button the record doesn't get deleted,
but the link to the table, which is the table that the data source SQL
statement is based on, gets deleted. I've used this wizard many times
before and have never had a problem. I'm stumped!
	 
	Code that got produced by the wizard:
	    Private Sub CmdD_Click()
	    On Error GoTo Err_CmdD_Click

	    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
	    DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
	 
	Exit_CmdD_Click:
	    Exit Sub
	 
	Err_CmdD_Click:
	    MsgBox Err.Description
	    Resume Exit_CmdD_Click
	    
	End Sub
	
	 
	Judy Johnson
	jjwrite at earthlink.net
	860-482-8651
	860-309-2484 (cell)
	 

	

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030520/1dd0f955/attachment-0001.html>


More information about the AccessD mailing list