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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top