T
Tony Williams
I have built a search form which has a list box which shows the results. On
clicking on one of the results it opens a form showing the record. The form
is built on a table tbldocument with a sub form based on tblinstitution.
There is a one to many relationship between the tables. The subform can hold
upto to 3 records for each matched record of the main form. The code on the
double click event is
Private Sub List3_DblClick(Cancel As Integer)
Dim MyWhereCondition As String
MyWhereCondition = "[txtRefNbr]=" & Me.[List3]
DoCmd.OpenForm "frmMDi", , , MyWhereCondition
End Sub
Where txtrefnbr is the field that links the two tables. When the form opens
it displays the first record in the subform but it may be that the record I
want is the second record. Is there anyway to open the main form and have
the subform show a record other than the first?
Hope I've made sense here
Thanks
tony
clicking on one of the results it opens a form showing the record. The form
is built on a table tbldocument with a sub form based on tblinstitution.
There is a one to many relationship between the tables. The subform can hold
upto to 3 records for each matched record of the main form. The code on the
double click event is
Private Sub List3_DblClick(Cancel As Integer)
Dim MyWhereCondition As String
MyWhereCondition = "[txtRefNbr]=" & Me.[List3]
DoCmd.OpenForm "frmMDi", , , MyWhereCondition
End Sub
Where txtrefnbr is the field that links the two tables. When the form opens
it displays the first record in the subform but it may be that the record I
want is the second record. Is there anyway to open the main form and have
the subform show a record other than the first?
Hope I've made sense here
Thanks
tony