Hi
You can either put code on the OnClick event of the button like this
Open your form in design view.
Select the button
Right click
In the properties box select Event column
Select OnClick
Select build (code)
it will look like this
Private Sub ButtonName_Click()
End Sub
Cut and paste this code inbetween the lines
DoCmd.Close
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FormB"
stLinkCriteria = "[RecordNumber]=" & Me![RecordNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
so that it looks like this
Private Sub ButtonName_Click()
DoCmd.Close
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FormB"
stLinkCriteria = "[RecordNumber]=" & Me![RecordNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
Of course change the ButtonName to what it is and the RecordNumber and FormB
but leave everything else as it is
Or
Use a macro to open the form at the correct record
Open your form in design view.
Select the button
Right click
In the properties box select Event column
Select OnClick
Select build (macro)
In the action column
Select Open Form
In the box below select the name of the form you want to open
In the Where line put this
[RecordNumber] = Forms![FormB]![RecordNumber]
Change RecordNumber and FormB to what they areally are.
Hope this helps