Solved

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

Posted on 2010-11-08
5
842 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This collection of functions covers all the normal rounding methods of just about any numeric value.
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

747 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