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
243 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

This very simple solution applies to a narrow cross-section of the "needs to close" variety. In this case, the full message in Event Viewer was in applog, Event ID 1000: Faulting application iexplore.exe, version 8.0.6001.18702, faulting module …
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now