How do I set a "drill down" on a specific cell in one form? So ca.

K

Ken B

I am simply trying to set up a drill down of data or a cell in a form.
The newly opened form will display data that adds up to or supports the
initial cell that was double clicked.
 
D

Dirk Goldgar

Ken B said:
I am simply trying to set up a drill down of data or a cell in a form.
The newly opened form will display data that adds up to or supports
the initial cell that was double clicked.

So the idea is that when you double-click this control (not a "cell",
that's Excel-speak"), another form will open that shows the supporting
detail?

First you need to be able to identify, from information in the current
record (the one you double-clicked), which detail records correspond to
it. Next you need to build a query that shows the necessary detail,
though not necessarily restricted to just the corresponding records, and
use this query as the RecordSource for a popup form. Then you need to
create an event procedure for this control's DblClick event that opens
that form while applying a WhereCondition argument to limit its
recordsource to just the relevant records. For example,

Private Sub txtBranchTotal_DblClick(Cancel As Integer)

Dim stLinkCriteria As String

If IsNull(Me.BranchOfficeID) Then Exit Sub

stLinkCriteria = "BranchOfficeID = " & Me.BranchOfficeID

DoCmd.OpenForm "frmBranchDetails", _
WhereCondition:=stLinkCriteria

End Sub

That's just an example, of course.
 
Top