Solved

Need to refresh (requery?) a datasheet view subform from the main form combo box

Posted on 2010-11-08
5
844 Views
Last Modified: 2013-11-28
Hello,

I have seen a billion threads that appear to be very close to what I need, but I still can't get it correct.  I therefore apologize if this has already been answered.  I have attached a generic version of the database I am building for your reference.  

The main form is Value_Chain.  This form has combo boxes at the top which input into each of my queries (I am aware the queries are inefficient).  The results of 4 of the queries are shown as subform datasheets.  I would like all these datasheets to update everytime a new selection is made in each of my combo boxes.  Please note that the "Date" combo boxes are required selections.  

Currently the subforms will ony update after a combo box change when I go to design view and back to form view.  This is obviously not practical.

I am not an Access genius (obviously), so please simplify when providing explanations.  I would prefer to not get into VBA, but I can if required (was thinking "After Update" event).  

Thank you in advance for your hellp Example.zip
0
Comment
Question by:MAC050
  • 2
  • 2
5 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34089977
Can you please post the explicit steps to recreate this issue?

Then tell us what is, ...or is not happening, and state how you want it fixed.
0
 

Author Comment

by:MAC050
ID: 34090009
1) Open the Form titled: "Value_Chain" in "Form" view
2) Select the dates 08/01/2010 and 09/01/2010 respectivelyfrom combo boxes labeled "Start Date" and "End Date"
3) You will notice that nothing occurs
4) Change the perspective to "Design" view
5) Change the perspective back to "Form" view
6) You will see that the data has populated the subforms in datasheet view

I would like for point 6 to occur immediately after point 2.

Does that make sense.  
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 34090050
place this codes accordingly


Private Sub Combo1_AfterUpdate()
If Not IsNull(Me.Combo2) Then
Me.[QRY_Test1F subform].Requery
Me.[QRY_Test2 subform].Requery
End If
End Sub

Private Sub Combo2_AfterUpdate()
If Not IsNull(Me.Combo1) Then
Me.[QRY_Test1F subform].Requery
Me.[QRY_Test2 subform].Requery
Else
MsgBox "select start date first"
Me.Combo1.SetFocus
End If
End Sub




here is the revised db


0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 34090052
0
 

Author Comment

by:MAC050
ID: 34090090
Awesome!  Thank you so much Capricorn.  I know understand what I was doing wrong!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

929 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now