Here is a picture to look at
http://www.barcodeone.com/winsoft/images/FindItFAST.jpg
In order for this to work you CANNOT have any Primary keys on the table where the main form is connected to.
In the subform's On_click event put this code
Private Sub Form_Click()
Dim SyncCriteria As String
Dim f As Form, rs As Recordset
'Define the from object and recordset object for the AutoCAD form
Set f = Forms(Screen.ActiveForm.FormName)
Set rs = f.RecordsetClone
' define the criteria used for the sync
SyncCriteria = "[stock_code]='" & Me![STOCK_CODE] & "'"
' find the corresponding record in the Parts table
rs.FindFirst SyncCriteria
f.Bookmark = rs.Bookmark
End Sub
Now view the form like normal, click in the far left gray square on the subform (look at sample picture above) these gray squares are the ones with the black arrow in it.
The main form will jump to the record on the subform.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.