469,928 Members | 1,848 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,928 developers. It's quick & easy.

Deleting record from subform in 2007

167 100+
I think I am just having a 'brain fog' moment... I can not remember how to do this. I have a main form and on the main form I have a subform(sfDetails). My subform is in datasheet view. I put a command button on my main form 'Delete Record'. I want to highlight a row on my datasheet(subform) and click the delete button on the main form and have it delete the record I have highlighted in the subform. I have used the following code behind the button: DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord

This is not deleting the data on my datasheet(subform). I know I am doing something incorrect, just not sure what!
Jul 16 '09 #1
1 3973
1,287 Expert 1GB
I couldn't remember this either, had to look it up:
Expand|Select|Wrap|Line Numbers
  1. mySubForm.Form.Recordset.Delete
  2. mySubForm.Form.Recordset.MoveNext
Jul 16 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by RAllsopp | last post: by
46 posts views Thread by DP | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.