?
Solved

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

Posted on 2010-11-08
5
Medium Priority
?
893 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

770 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