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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
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…

775 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