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

Moving a subform with a command button

Status
Not open for further replies.

ind

Programmer
Mar 9, 2000
121
US
I want to move to a new record on a subform using a command button on the main, rather than using the scroll bar or the navigation buttons.<br>How do I do this?
 
use a macro. See goto control and goto record.
 
What version of Access are you using? You should be able to just choose the button tool from the toolbar, then drop it on the form, and choose The &quot;Go to next Record&quot; from the wizard. <p>John Vogel<br><a href=mailto:johnvogel@homepage.com>johnvogel@homepage.com</a><br><a href= FreeDSL Service</a><br>[To a get FREE DSL Modem WITH FREE DSL Unlimited Internet Connection click the above link :)]
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'add record to sub form<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Me![Drawings subform].SetFocus<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.GoToRecord , , acNewRec<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'assign a value to a field in that sub form<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Me![Drawings subform].Form![DrawingNumber] = ActiveXCtl1.FileName<br><br> &nbsp;&nbsp;&nbsp;&nbsp;'save the record<br>&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70<br><br> &nbsp;&nbsp;&nbsp;' Requery the sub form<br>&nbsp;&nbsp;&nbsp;&nbsp; Me![Drawings subform].Requery<br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top