how to click a subform (datasheet view) to open another subform

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

Guest

Hi,
I have a subform in DS view, when an user click on any cell, the sub
subform (form view) will display the detailed of that order (from a different
table). Is there a way to do that? One of the things I am trying to
accomplish is when the user click on the subform, it needs to be able to
query and find the primary key of that record (the field is not shown on DS
view).


Thanks,
 
Jeff said:
Hi,
I have a subform in DS view, when an user click on any cell, the sub
subform (form view) will display the detailed of that order (from a different
table). Is there a way to do that? One of the things I am trying to
accomplish is when the user click on the subform, it needs to be able to
query and find the primary key of that record (the field is not shown on DS
view).

As long as the key is in the underlying recordset of the subform, you can
refer to it. I like to put the control on the subform and set it's visible
property to false, so that I can be sure it's there. The code to open your
Orders form would be a line in the subform detail's double-click event like:

DoCmd.OpenForm "Your Form",,,"PK=" & Forms!ThisFormName!txtPKControlName

You will need to add that code to the form's double-click event (if using
record selectors), and to each control that you want to trigger the event.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top