Hi all,
Main form and Subform data is taken from the same table.
The subform is a grid used as an index for the main form in the same window.
I have a number of filters which I want to filter the subform and Main form. When I select a record in the subform, I want to go to that record in the the Main Form.
This is the code I used in the subform.
Private Sub Form_Current()
For i = 1 To 150
If Me.Form!ID = i Then
DoCmd.GoToRecord acDataForm, "LoomSpecs", acGoTo, i
Else
End If
Next
End Sub
With no filter this works perfect.
Because the subform filtered [ID] field does not match the Main form recordset it causes a crash.
Any suggestions would be appreciated.
Thanks
S.
Main form and Subform data is taken from the same table.
The subform is a grid used as an index for the main form in the same window.
I have a number of filters which I want to filter the subform and Main form. When I select a record in the subform, I want to go to that record in the the Main Form.
This is the code I used in the subform.
Private Sub Form_Current()
For i = 1 To 150
If Me.Form!ID = i Then
DoCmd.GoToRecord acDataForm, "LoomSpecs", acGoTo, i
Else
End If
Next
End Sub
With no filter this works perfect.
Because the subform filtered [ID] field does not match the Main form recordset it causes a crash.
Any suggestions would be appreciated.
Thanks
S.