Solved

How do you open a subform to a certain record when it contained on a page in a tab control?? Access 2010

Posted on 2012-04-10
3
253 Views
Last Modified: 2012-04-28
I have a Form called frm_Main that contains a tabcontrol caled TabCtl0.
On there are 2 pages , Page1 & Page2.

Page1 has subform called Customers and Page2 has subform called Reports.

Basically How do i open frm_Main to Page1  to subform "Customers"  with a value selected from a popup window.

I have this on the close of the popupwindow

I have it grabbing the value correctly on the close of the popupwindow

 
 DoCmd.OpenForm "frm_Main"
With Forms("frm_Main")
!TabCtl0.Value = !Page1.PageIndex 'gets the correct Page (Tab)
Me![Customers].RecordSource = "select * from tMaster where l_ID = 542"
'using a hardcoded value as a test
End With

Any help or insight would be great..
0
Comment
Question by:nomar2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 90 total points
ID: 37830770
Try:

Me![Customers].form.RecordSource = "select * from tMaster where l_ID = 542"

Open in new window


Also see: Refer to Form and Subform properties and controls
0
 

Author Comment

by:nomar2
ID: 37834516
Never worked saying ....object closed or doesn't exist..

Created a form named frm_Main

Created a tab control and dragged a form that I already created (frm_Master) unto the page of the tab control.

After creating it ..it says the subform name is Customer with the Source_object being frm_Master.

So I have frm_Main
a tabcontrol with 2 pages (Page1, Page2)
Page1 - I dragged a form already created (Frm_Master), after dragging if you click the outer frame below the Page1 tab it says Selection Type: Subform/SubReport
In the properties it says Name: Customer
Source_Object:frm_Master

On the frm_Master there is accounts with machines associated with that account.
I click a popup window, it shows details of the selected machine. On that screen you can deactivate a machine...so when that popup closes I want the form to reload with the recently deactivated not showing, this all worked until I moved to a tab control


How do I reload this form to a selected value when a popup window closes.The popup window comes from frm_Master?
So when i close the popup window I want the window to close and the form refresh to the accountID selected from the popup window.. I have this action coded under the close button of the popup window.

Been all over google trying to get this to work.

Will increase the points if I can get working..
0
 

Author Comment

by:nomar2
ID: 37905944
Finally Solved..

Forms![Navigation Form].NavigationSubform.Form.RecordSource = "select * from tMaster where l_ID = " & lnCustID

[Navigation Form] --> this is the name of your form
NavigationSubform --> this is the name of the form form that you drag the form onto ( select the subform and check the name)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

726 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