• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

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

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
nomar2
Asked:
nomar2
  • 2
1 Solution
 
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
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
 
nomar2Author Commented:
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
 
nomar2Author Commented:
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now