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

SubForms and main Form

Status
Not open for further replies.

ZeuBug

Programmer
May 16, 2000
10
FR
Hi,<br><br>the problem is :<br>i have a main form, on this main form there is a control tab.<br>on each page of control tab, i have one subform.<br><br>I want to put a button on the main form, this button must delete the current record of the visible subform.<br><br>I don't want to put the button on the subform cause it was not quiet for the user.<br><br>thanks <p>Raph<br><a href=mailto:rchene@rockefeller.univ-lyon1.fr>rchene@rockefeller.univ-lyon1.fr</a><br><a href= > </a><br>
 
First Set focus to the subform.<br>Then Select the record<br>Then Delete it. As Follows: (in Access '97) <br><br>&nbsp;&nbsp;&nbsp;'First Set focus to the subform.<br>&nbsp;&nbsp;&nbsp;&nbsp;Me![Contacts subform].SetFocus<br>&nbsp;&nbsp;&nbsp;&nbsp;' Then Select the record<br>&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70<br>&nbsp;&nbsp;&nbsp;&nbsp;' Then Delete it<br>&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70 <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
thanks doug , i didn't think to get the focus on the subform.<br><br>but i had a problem, an error came when the line<br>DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70<br>was executed<br><br>so i used the command DoCmd.RunCommand acCmdDeleteRecord<br><br>and that's all right<br><br>Thanks <p>Raph<br><a href=mailto:rchene@rockefeller.univ-lyon1.fr>rchene@rockefeller.univ-lyon1.fr</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top