Solved

Microsoft Access 2010 Subform question

Posted on 2016-08-30
5
63 Views
Last Modified: 2016-09-06
How do I create a function to go to subform to subform?
I would like to double click a record and jump to main subform
Database41.zip
0
Comment
Question by:Hiroyuki Tamura
  • 2
  • 2
5 Comments
 
LVL 35

Assisted Solution

by:[ fanpages ]
[ fanpages ] earned 250 total points
ID: 41777843
Sorry, what would you like to double-click, & what would you like to happen after this?

You only have one sub-form in your database at present.

Q_28966718
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 41777896
You can set the focus to a Subform, but how you do that depends on WHERE you're doing that, as fanpages suggests.

If you're doing this from the parent form, then you simply do this:

Me.NameOfYourSubformControl.Form.SomeControlOnThatForm

Note that NameOfYourSubformControl may or may not be the same as the name of the form you're using as the SourceObject of that control, so be careful. This trips up a lot of people!

If you have two subforms on the SAME parent form, then you have to first refer to the Parent, and then the other subform:

Me.Parent.NameOfSecondSubformControl.Form.SomeControlOnThatForm

If the subforms on on two different parent forms, then you have to refer to the Parent form of the second subform via the Forms collection:

Forms("ParentFormOfSecondSubform").NameOfSubformControl.Form.SomeControlOnThatForm
0
 

Author Comment

by:Hiroyuki Tamura
ID: 41778605
sorry, would you give me sample database? not sure where i should put the script.
0
 

Author Comment

by:Hiroyuki Tamura
ID: 41778804
> what would you like to double-click, & what would you like to happen after this?

is there a way to put a button on subform?
after clicking, jump to related record on other form.
0
 
LVL 35

Accepted Solution

by:
[ fanpages ] earned 250 total points
ID: 41779252
is there a way to put a button on subform?
after clicking, jump to related record on other form.

You could have a button on the main (parent) form that, when clicked, retrieves the [ID] from the currently selected row in the subform, & uses that as the source of a secondary subform (displayed elsewhere on the parent), or as the source of a new form (not a subform of the current parent form).

If you would like to add a second subform to your example database, & change the "Table1" form to show both subforms, then I/we can advise you how to use a button to link both subforms together.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Some sers suddenly getting error popup msg 28 89
Access 2016 - Labels prompt to print 4 31
Access 2016 7 34
Create a EXCEL FIle from Access Procedure 1 16
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question