Calender record call-up

A

A Jones

How can i select a date on the calender control and call
up the record for that date?
any help or alternatives greatly appreciated.
 
P

PC Datasheet

Put the following code in the OnClick event oif a command button:

Dim Rst As DAO.Recordset
Set Rst = Me.Recordsetclone
Rst.FindFirst "[NameOfDateField] = #" & Me!NameOfCalendarControl.Value & "#"
If Not Rst.NoMatch Then
Me.BookMark = Rst.Bookmark
Else
MsgBox "There Is No Record For The Date You Selected"
End If
Rst.Close
Set Rst = Nothing

Note: Code assumes the calendar is on your form
 

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