• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 916
  • Last Modified:

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

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
MAC050
Asked:
MAC050
  • 2
  • 2
1 Solution
 
Jeffrey CoachmanCommented:
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
 
MAC050Author Commented:
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
 
Rey Obrero (Capricorn1)Commented:
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
 
Rey Obrero (Capricorn1)Commented:
0
 
MAC050Author Commented:
Awesome!  Thank you so much Capricorn.  I know understand what I was doing wrong!
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now