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

Urgent. Subforms not refreshing when I want them to

Using Access 2000.

First I will explain my current form structure.  It is very complicated to say the least.

The main form (Frm_MainSample_Entry) contains one large Tab Control with 6 tabs.  I am only going to discuss the ones that pertain to my problem.

The three tabs of intrest are |Sample Entry|  |Detailed Sample Entry|  |Analysis Information|

The Sample Entry tab contains a subform called Frm_DataEntry_MainDataEntry.  This is where the intial information is entered (CustomerNumber, Entry Date) .  There are several subforms in this subform used for simple sample checkin procedures, but I do not believe they are of importance here.

The Detailed Sample Entry tab contains a subform to deal with samples that require a great deal if information to be entered.  Here the sample type is entered (SampleSubID).
This subform is linked to the MainDataEntry subform with the aid of what I call a link box.  an unbound text box control called "CustomerLinkB" is placed on the MainSample_Entry Form and is equal to the MainDataEntry Subforms CustomerNumber The subform on the Detailed Sample Entry Tab is linked to this CustomerLinkB control.

There is a subform on this subform listing typical sample types that are specific to the customer number entered on the previous tab.  This list is linked to the CustomerNumber of the detailed checkin subform.  This is only for Information sake.

On the Analysis Information tab is where I am having my troubles.
I had set this tab up two differet ways to try to fix my problem.  I will describe the former, because the latter I know is a problem.

The Analyses tab contains three subforms  Frm_DataEntry_SampleTestInfo, Frm_List_Analyses, and Frm_List_CustomerTestDefaults.  The first two subforms I am not having any problems with.  It is the Third.

This third subform contains yet another tab control with three tabs |Sample Defaults|  |Customer Defaults|  |All Test Codes|.  Each tab control then contains another subform to list each tabs contents.  I am having troubles with the first two tabs and subforms here.  These two forms contain criteria in their queries that links back to the CustomerNumber and SampleSubID of the previous subforms.  I can not get them to automatically update upon the entry of the customernumber and sample Type.  All attempts have failed.  except one...If I click on the subforms that are not updating and press F9, then they update.  

I have tried several refresh, requery, repaint combos, I even tried some F9 sendkey options, but I must not be doing them propperly.  I know this is a complicated structure, but I could use any advise.  Also I am going live with this DB today, so Time is very important too.

Because of the time importance, I will offer an additional 500 points for this post.

Thanks,
0
sophisticatediowan
Asked:
sophisticatediowan
  • 4
  • 4
  • 3
  • +2
4 Solutions
 
sophisticatediowanAuthor Commented:
I also have a copy setup where the subform with the three tabs that contain the 3 other subforms is in the footer of the Frm_DataEntry_SampleTestInfo form.

Not like it makes a huge difference.

Thanks,
0
 
ArjiCommented:
There is a definite limit to how many subforms you can have on a form.  If you exceed that limit things will not work right.  I've done that been there.  Being that you have tried pretty much everything, you might try the refresh command or the save record command to see if everything updates:

DoCmd.RunCommand acCmdRefresh
or
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acRefresh, , acMenuVer70
or
DoCmd.RunCommand acCmdSaveRecord
or
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

0
 
thenelsonCommented:
Are you using the correct subform syntex?

Forms![Main Form]![Sub Form]![Sub Sub Form]![Sub Sub Sub Form].Requery
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
dmerrowCommented:
I had a similar problem, and setting each of the subforms' recordsource properties to itself worked:

like...

subform1.recordsource=subform1.recordsource
subform2.recordsource=subform2.recordsource
...etc.

dm
0
 
ve2dcCommented:
did you try .recalc ?
0
 
sophisticatediowanAuthor Commented:
It's been a very wild day.  I have not had any time to get to this problem.  I'll be working on it tonight.

Thanks,
0
 
sophisticatediowanAuthor Commented:
OK all I have it working propperly.

Private Sub SampleType_AfterUpdate()
Me.Dirty = False
Forms!Frm_MainSample_Entry!Frm_DataEntry_SampleTestInfoSubform.Form!Frm_List_Sample_Default_Sub.Form!Frm_DataEntry_Test_Combinations_Cust_Samp_Sub.Requery

End Sub

So what do I do with the points if I fix my problem myself?  I would be willing to split the points amoung you all, but I am not allowed to accept my own post as the answer.
0
 
ArjiCommented:
I think you can have support close out the question but it looks like thenelsons answer was closest to your solution.  You could also try other solutions to see if they work too.  It will at least honor the time we all spent thinking about it and answering.
0
 
thenelsonCommented:
I glad you got it.  

Me.Requery will requery the main form.

Forms![Main Form]![Sub Form]![Sub Sub Form]![Sub Sub Sub Form].Requery
or
Me![Sub Form]![Sub Sub Form]![Sub Sub Sub Form].Requery
will requery the Sub Sub Sub Form and everything above it.  (However it will not requery parallel subforms  ie: Me![Another Sub Form]
0
 
sophisticatediowanAuthor Commented:
How about thenelson as the accepted answer and everyone else gets an equal piece of the pie :).

Thanks,
0
 
ArjiCommented:
That's fair!
0
 
thenelsonCommented:
Sounds good to me.
0
 
ve2dcCommented:
BTW... I had a problem refreshing combo box drop-down lists, and found that .recalc worked... not .requery

I guess the .requery just refreshes the record source... is this correct? (Yup, I'm pretty new to Access!)
0
 
ArjiCommented:
I'm surprised .Requery didn't work.  Hmmmmm... Requery does refresh the rowsource so that any new additions to that rowsource are shown in the list.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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