[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Urgent.  Subforms not refreshing when I want them to

Posted on 2005-04-25
16
Medium Priority
?
282 Views
Last Modified: 2010-05-18
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
Comment
Question by:sophisticatediowan
  • 4
  • 4
  • 3
  • +2
14 Comments
 
LVL 1

Author Comment

by:sophisticatediowan
ID: 13860629
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
 
LVL 17

Assisted Solution

by:Arji
Arji earned 500 total points
ID: 13860790
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
 
LVL 39

Expert Comment

by:thenelson
ID: 13861190
Are you using the correct subform syntex?

Forms![Main Form]![Sub Form]![Sub Sub Form]![Sub Sub Sub Form].Requery
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 3

Assisted Solution

by:dmerrow
dmerrow earned 500 total points
ID: 13861230
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
 
LVL 1

Assisted Solution

by:ve2dc
ve2dc earned 500 total points
ID: 13862085
did you try .recalc ?
0
 
LVL 1

Author Comment

by:sophisticatediowan
ID: 13863058
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
 
LVL 1

Author Comment

by:sophisticatediowan
ID: 13867059
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
 
LVL 17

Expert Comment

by:Arji
ID: 13867146
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
 
LVL 39

Accepted Solution

by:
thenelson earned 500 total points
ID: 13868036
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
 
LVL 1

Author Comment

by:sophisticatediowan
ID: 13869646
How about thenelson as the accepted answer and everyone else gets an equal piece of the pie :).

Thanks,
0
 
LVL 17

Expert Comment

by:Arji
ID: 13869714
That's fair!
0
 
LVL 39

Expert Comment

by:thenelson
ID: 13869745
Sounds good to me.
0
 
LVL 1

Expert Comment

by:ve2dc
ID: 13870247
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
 
LVL 17

Expert Comment

by:Arji
ID: 13870425
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

834 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