thisform.r_cstarttime = datetime(ln_year, ln_month, ln_day, ln_hours, ln_minutes, ln_seconds)If there's a reason than you have to evaluate the expression stored in thisform.r_cstarttime to get datetime
ldt_starttime = EVAL(thisform.r_cstarttime )Actually it wouldn't work because all variables in that expression are alreday out of scope at that time.
>Method.m_timer() >***begin >with thisform.Hscntemail > lc_date = .hstxtdate.value > ln_year = year(lc_date) > ln_month = month(lc_date) > ln_day = day(lc_date) > ln_hours = .hspnhours.value > ln_minutes = .hspnminutes.value > ln_seconds = .hspnseconds.value >.Hstxtstarttime.value = ltrim(str(ln_year)) + ", " + ltrim(str(ln_month)) + ", " + ltrim(str(ln_day)) ; >+ ", " + ltrim(str(ln_hours)) + ", " + ltrim(str(ln_minutes)) + ", " + ltrim(str(ln_seconds)) >thisform.r_cstarttime = "datetime(" + ltrim(str(ln_year)) + ", " + ltrim(str(ln_month)) + ", " + ltrim(str(ln_day)) ; >+ ", " + ltrim(str(ln_hours)) + ", " + ltrim(str(ln_minutes)) + ", " + ltrim(str(ln_seconds)) + ")" >endwith > >****end > > >This method wants to make the time fire the m_email() method which creates and send the email through automation. > >I can't seem to get the syntax right, data mismatch error message. > > >method.m_starttime() >***method located in timer event of timer control >***begin >ldt_starttime = thisform.r_cstarttime && r_cstarttime comes from m_timer method >ldt_stoptime = ldt_starttime + 2 && wants to add 2 secconds to datetime() start >if datetime() > ldt_starttime and datetime() < ldt_stoptime && runs m_email() > thisform.m_email() > This.enabled = .f. >Endif >***end