I 'borrowed' the following code from somewhere, sorry I don't recall where
but it allows you to sync two forms (move from one record in the first,
moves the record in the second)
in the code module:
Function IsLoaded(ByVal strFormName As String) As Boolean
' Returns True if the specified form is open in Form view or Datasheet view.
Const conObjStateClosed = 0
Const conDesignView = 0
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed
Then
If Forms(strFormName).CurrentView <> conDesignView Then
IsLoaded = True
End If
End If
End Function
In 'FORM1' oncurrent event
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form2"
stLinkCriteria = "[LinkKey]=" & Me![LinkKey]
If (IsLoaded(stDocName) = True) Then
Forms!(stDocName).FilterOn = True
Forms!(stDocName).Filter = stLinkCriteria
End If
Now changing records in form1 changes the record in form2.
Another option is to use the 'button wizard' when you put a new button on
the form it askes if you want to open a form, if so it asks if you want to
all records or specific records, you thell it what form you want to open and
what the matching keys are and it builds the code for you in the
button_click event. I then add a little code to the double click event to
open the associated form when the first form is double clicked
Call button1_onClick()
Ed Warren