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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to automatically refresh subform! 3

Status
Not open for further replies.

steve728

Programmer
Mar 16, 2003
536
0
0
US
I'm using Access 2000. I have a mainform, a subform and a subform2. Subform2 has a backend query that is filtered on the subform rec data. I want subform2 to automatically refresh whenever I move up and down recs in subform. I tried the following code in the subform on current event:

forms![mainform]![subform2].form.refresh &
forms![mainform]![subform2].refresh

with no success.

Please help me with some helpful ideas!

Steve
 
You might try using the Requery method rather than the refresh.

[Forms]![mainform]![subform2].Requery

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
You're my hero Man! You should wear a cape! I applied a star to you.

Thankssssssss!!!!!

Steve
 
Try:
Forms(Parent.Name).Controls("subform2").Form.Recordset.findfirst "subform2_Id = " & subform_Id

This will work if the subform2 should contain one filtered record that should correspond with subform, otherwise:

Forms(Parent.Name).Controls("subform2").Form.Filter = "subform2_Id = " & subform_Id
Forms(Parent.Name).Controls("subform2").Form.FilterOn = true

This should filter all the records that match you selection in subform

I hope it'll work

 
Thank you steve728, glad I could help out. At least one thing has gone right today.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top