View Full Version : How to do data-bound objects


zander
10-27-2001, 04:41 AM
If i create a calendar object on a form (In Access 97) how can i get the date the user selects on the calendar to update a text control on the same form

Jack Cowley
10-27-2001, 10:06 AM
The Calendar Control does not contain a Click event so you have to write your own. This should work for your:

Private Sub Calendar_Click()

On Error GoTo Calendar_Click_Error

Me![YourTextBoxName].Value = Calendar.Value

Calendar_Click_Exit:
Exit Sub

Calendar_Click_Error:
MsgBox Err.Description
Resume Calendar_Click_Exit

Be sure your Calendar Control is named Calendar.

zander
10-28-2001, 01:03 AM
Thanks Jack... Much appreciated... works like a charm... after some minor twiddling ;-)