Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery a subform in MS ACCESS

Status
Not open for further replies.

Hengameh75

Programmer
Jan 12, 2010
5
US
I have a main form that is Form2 and a subform that is called subformSystemIssue and other subform that is called SubformSystemAction. Form2 is parent of my subformSystemIssue and subformSystemIssue is the parent Of my subformSystemAction.
I have a product combobox on my form2(Main) that when I change it there is a text field on form2 and will be change and shows the ProductfamilyID related to that product.And on the SubformSystemAction I have a combobox which is showing the list of corrective actions and I want to show just the corrective Action for ProductFamilyID#x that I select in my first combo box on main form. I have all the connection and is working for the first time that I open my form. when I change the value in product combobox I have to re-open the form to see the refresh combo box for corrective action or press f9. I tried Forms.Form2.subformSystemIssue.Form.subformSystemAction.Form.CorrectiveAction.Requery for text field that it shows productfamilyID in afterUpdate event on the main form and still I have same problem. is there any comments?
 
How are ya Hengameh75 . . .

Try the following line in the [blue]After Update[/blue] event of [blue]Products[/blue] combobox:
Code:
[blue][subformSystemIssue].Form![subformSystemAction].Form![purple][b]ActionComboboxName[/b][/purple].Requery[/blue]

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Thanks for your answer but still I have same problem.
hengameh
 
In the AfterUpdate event procedure of the product combobox (after setting the ProductfamilyID value):
Code:
With Me!subformSystemIssue.Form!subformSystemAction.Form!CorrectiveAction
  .RowSource = .RowSource
End With

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
And this ?
Me!subformSystemIssue.Form!subformSystemAction.Form.Recalc

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hengameh75 . . .

I ran a simulation of what you show you have nd had no problems!

Post back the [blue]name[/blue] of the mainforms combobox along with its [blue]rows ource[/blue].

Also post back the [blue]row source[/blue] of the [purple]CorrectiveAction[/purple] combobox.

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
And make sure when using the name in the code you are using the name of the subform CONTROL (control on the main form that houses the subform) and NOT the subform name itself (unless the subform control and the subform have the exact same name).

Bob Larson
Free Access Tutorials and Samples:
 
Thanks for your reply I have a word doc file and I don know how to attach here, I explain every thing in that file.
Hengameh
 
Hengameh75 ...

We don't need further explanation. We know exactly what you want!

You can simply cut & paste the info in the doc into your next thread. Wether you do this or not ... [blue]its more important[/blue] you provide the info I asked for in my post dated [blue]14 Jan 10 20:10[/blue]. If your having problems providing this info ... say so and we'll step you thru it.

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Hello
Main Form= Form2
Row source for product=SELECT Products.ProductID, Products.PartNumber, Products.ProductName, Products.ProductFamilyID FROM Products;
Row source for corrective action= Requery
(Requery is a query including CorrectiveActionID,ActionName,PartNumber,ActionType,ProductfamilyID)and ProductFamilyID is coming from main form :[Forms]![Form2]![ProductFamilyID]
Thank you so much
Hengameh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top