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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I use an ActiveX Calendar to select records?

Status
Not open for further replies.

johnfrani

Technical User
Oct 2, 2002
33
US
How can I best allow a user to click on a date on an Access 2000 ActiveX Calender Control to only display the records in a subform that meet the date criteria selected on the calendar?

I need to know, specifically, what to do and where to do it because I am new to Access and VB.

I have a Form named frmOTScheduler.
The ActiveX Calendar Control is named MyCalendar and is on frmOTScheduler.
The subform on frmOTScheduler is named sfrmJobsOfficer. sfrmJobsOfficer is created by a query named qryJobsOfficer. This query selects all records in the tblJobsOfficer table.

TIA
John
 
Private Sub ActiveXCtl2_Click()
T1 = ActiveXCtl2
End Sub


For some reason, the events available with ActiveX Controls are not listed on the properties pane in form design view.

If you go into the code module, select the ActiveX Control's name from the 'Object' dropdown list, you'll be able to see an expanded list of events on the 'Procedure' drop-down. OnClick is there.
 
How do I capture the value of the selected calendar date and use it to either filter the records in the subform or insert this value in the query that creates the records in the subform?

What code do I use?
Where do I put it?

Thanks
John
 
I found a simple answer to my own question.
Select the ActiveX Calendar control.
Note the exact name of the control.
Select the subform frame.
Open the properties dialog box for the subform.
Link Child Fields = the date field on the subsform you want to filter by.
Link Master Fields = the exact name of the ActiveX Calendar control. (in my case, it was ActiveXCtl0)
View the form.
Select a date on the calendar.
Click on any data in the Date field on the subform.
You should see only records that match the date criteria selected by the calendar.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top