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

Need to Select a record in a Subform...

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I Need to Select a record in a Subform so I can add new values to some of the fields in that record<br><br>I tried this but it does not do anything<br>--------------------<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim f As Form, rs As Recordset<br>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;'Define the from object and recordset object for the AutoCAD form<br>&nbsp;&nbsp;&nbsp;&nbsp;Set f = Me![Drawings to Print subform].Form<br>&nbsp;&nbsp;&nbsp;&nbsp;Set rs = f.RecordsetClone<br>&nbsp;&nbsp;&nbsp;&nbsp;rs.MoveLast<br>&nbsp;&nbsp;&nbsp;&nbsp;Debug.Print rs.RecordCount<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;' define the criteria used for the sync<br>&nbsp;&nbsp;&nbsp;&nbsp;SyncCriteria = &quot;[Part Number]= &quot; & Chr$(39) & Me![Text24] & Chr$(39)<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;' find the corresponding record in the Parts table<br>&nbsp;&nbsp;&nbsp;&nbsp;rs.FindFirst SyncCriteria<br>&nbsp;&nbsp;&nbsp;&nbsp;f.Bookmark = rs.Bookmark<br>------------------------- <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.
 
I just figured it out myself!!!!<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Dim FormName As String, SyncCriteria As String<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim f As Form, rs As Recordset<br><br>&nbsp;&nbsp;&nbsp;&nbsp;'Define the from object and recordset object for the AutoCAD form<br>&nbsp;&nbsp;&nbsp;&nbsp;Set f = Me![Drawings to Print subform].Form<br>&nbsp;&nbsp;&nbsp;&nbsp;Set rs = f.RecordsetClone<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;' define the criteria used for the sync<br>&nbsp;&nbsp;&nbsp;&nbsp;SyncCriteria = &quot;[Part Number]= &quot; & Chr$(39) & Me![Text24] & Chr$(39)<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;' find the corresponding record in the Parts table<br>&nbsp;&nbsp;&nbsp;&nbsp;rs.FindFirst SyncCriteria<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;f.Bookmark = rs.Bookmark<br>&nbsp;&nbsp;&nbsp;&nbsp;f!Released = True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; Just Added these 2 lines<br>&nbsp;&nbsp;&nbsp;&nbsp;f![Date Released] = Format(Now, &quot;mm/dd/yy&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Me![Drawings to Print subform].Requery<br> <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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top