Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Date-Run Query-Update Results on SubForm

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
0
0
US
Below is the code I have for a calendar control. It works just find. My dilemma is as follows:

I have turned a query that I have "WeeklyOmsPageCountByPerson" into a subform "Page Count Date Range" on my form "OmsStatus". After I select the date on the calendar control, I would like for the the query to run or requery and the results update on the SubForm "Page Count Date Range" as soon as the query runs. I have been trying to requery and get the SubForm to update to no avail. Any examples or suggestions on how to accomplish this?

Code:
Private Sub StartDateTxt_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

CalStart.Visible = True
   CalStart.SetFocus
   If Not IsNull(StartDateTxt) Then
      CalStart.Value = StartDateTxt.Value
   Else
      CalStart.Value = Date
   End If

End Sub

Private Sub CalStart_Click()

    StartDateTxt.Value = CalStart.Value
    StartDateTxt.SetFocus
    CalStart.Visible = False
    


End Sub
 
Does your query look at the date stored in the control storing the date you selected using the calendar? If it does, you should be able to requery the subform if the subform is based on that query.

Lena
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top