an said:
Thanks for reply.
Then, the complet "story" is:
I have:
T_Sectors and T_Quart
(Relationships: One Sector to many Quart)
F_Sectors based in T_Sectors, with CboSectors based in same table, and
CboQuart
based in T_Quart.
In Row Source:
"SELECT [T_Quart].[Quarter] FROM T_Quart WHERE [IdSector]=[Text72];"
where [text72] is an auxiliar textbox .
The CboQuart result of the CboSectors (Filtered records)
In Detal section:
A SubF_Quart, based in T_Quart, show us records resulting from
CboSectors too. I would like to put an evidence a SubF_Quart's
record, through click on row of the CboQuart in F_Sectors.
But I don't know if is it possible...
I take it that "SubF_Quart" is a subform? So, you want to use CboQuart,
which is on the main form, to find a record on the subform? Yes, that's
possible, but the combo box wizard won't build it for you. The code for
the combo box would look something like this:
'----- start of code (note: "air code") -----
Private Sub CboQuart_AfterUpdate()
Dim frm As Access.Form
Set frm = Me!SubF_Quart.Form
With frm.RecordsetClone
.FindFirst "Quarter = " & Me!CboQuart
If .NoMatch Then
MsgBox _
"The quarter you selected was not found in the " & _
form's current recordset. Remove any filter " & _
"you've applied, and try again.", _
vbInformation, _
"Not Found"
Else
frm.Bookmark = .Bookmark
End If
End With
Set frm = Nothing
End Sub
'----- end of code -----
Note that the above code assumes that Quarter is a numeric field. If
it's a text field, the .FindFirst call should be like this:
.FindFirst "Quarter = '" & Me!CboQuart & "'"
It also assumes that "SubF_Quart" is the name of the subform control on
the main form, and not merely the name of the form that is its
SourceObject.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)