Delete Record

Lynn_AccessUser

Registered User.
Local time
Today, 03:49
Joined
Feb 4, 2003
Messages
125
I have a form which opens to a filtered record. Problem if the user deletes the record for some reason it goes to a new record. I created the delete button using the wizard and added a line to close the form.
 
Lynn_AccessUser said:
I created the delete button using the wizard and added a line to close the form.

Would the code attached to that button look anything like:

Code:
DoMenuItem.

If so, delete the lines and replace them with:

Code:
DoCmd.RunCommand acCmdDeleteRecord
 
Yea, I thought of that also and tried it but it still goes to a new record.
 
What method have you used to open the form filtered to a record?
 
On the search form the user can choose the ReqID from a combo box. The combo box is called cboReqID.

On the load event of the form I have:

Me.Filter = "ReqID=" & Forms!frmSearch!cboReqID
Me.FilterOn = True
 
No idea, then, as I wouldn't (and haven't) use the FilterOn etc. properties. Rather than performing a filter on the form's load event I would do the filter on the calling form (the search form in your case)

i.e.

Code:
DoCmd.OpenForm "MyForm", , , "ReqID = " & CLng(Me.cboReqID)
 
What is strange is that I am doing almost the same thing in another db using the same method of filtering to a specific record when the form loads and I am not having any issues.
 

Users who are viewing this thread

Back
Top Bottom