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
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
250 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
  • 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

808 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