Active X Calendar

L

Lancaster

I have a form with a Active X Calendar. I want the user
to be able to click on a date and pull the record from the
recordset with that date into the form. I am not sure how
to code this. Any help would be greatly appreciated. :)
 
P

PC Datasheet

Create a pop-up form called PFrmCal, install the calendar control on it and name
the calendar control Cal.

Put the following code in the OnClick event of the calendar:
Me.Visible = False


Put the following code in the Click event of a button on your form that displays
the data from the recordset:

Dim Rst As DAO.Recordset
Set Rst = Me.RecordsetClone
DoCmd.OpenForm "PFrmCal",,,,,acDialog
Rst.FindFirst "[NameOfDateField] = #" & Forms!PFrmCal!Cal.Value & "#"
Me.BookMark = Rst.BookMark
DoCmd.Close acForm, "PFrmCal"
Rst.Close
Set Rst = Nothing

The button will open the calendar form. When you click on a date on the
calendar, the calendar will disappear and your form will jump to the record with
the date the same as you clicked on the calendar.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top