Solved

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

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

738 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