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

subform filter problem

Status
Not open for further replies.

Sadukar

Technical User
Feb 19, 2003
159
IE
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top