I have the following code in the Update Event of a Calendar but it 
does nothing.  I put the same code behind a command button and the 
code works. 
I put an text box on the form and made the control source the 
calendar.  After I select a month, then day and tab out of the 
calendar the correct date appears in the in the text box, but my 
code won't run 
Does anyone know why the "Update" will not run the code?
Thanks
Chris

Private Sub CalDate_Updated(Code As Integer)
MsgBox "1"
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String

Set db = CurrentDb

strSQL = "SELECT tblTimecard.Client_ID, DatePart(""d"",[TCDt]) AS 
DayCd, " & _
  "tblTimecard.Hrs, DatePart(""m"",[tcdt]) AS MthCd, DatePart
(""yyyy"",[TCDt]) " & _
 "AS YrCd, tblTimecard.TCDt, tblTimecard.activityDt " & _
  "FROM tblTimecard " & _
  "WHERE (((tblTimecard.Client_ID)=[forms]![frmTimeCard].
[Client_ID]) " & _
  "AND ((DatePart(""m"",[tcdt]))=[forms]![frmTimeCard].
[txTimeCardMonth]) " & _
  "AND ((DatePart(""yyyy"",[TCDt]))=[forms]![frmTimeCard].
[txTimeCardYear]));"
MsgBox strSQL
db.QueryDefs("qry_TC_Finished_01").SQL = strSQL
MsgBox db.QueryDefs("qry_TC_Finished_01").SQL

Me.ctl_frm_Finished.SourceObject = "frm_Finished"
End Sub




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/q7folB/TM
--------------------------------------------------------------------~-> 


Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AccessDevelopers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to