Hi,
 
On executing the following code in Access 2002 it gives me "Run Time Error '13': Type Mismatch"
 
What could be the problem.
 
What I am trying to do is. I have 2 unbound dtppicker controls on a unbound form. I want to insert all the dates between 1st and 2nd dtppicker controls (including dates selected) into a temporary table on clicking a command button named cmdProcessLeave on the form.
 
TotalLeaveDays is a sub procedure which calculates no. of days between two dates and stores them in a variable named LeaveDays of type integer.
 
Private Sub cmdProcessLeave_Click()
Dim dbs As Database
Set dbs = CurrentDb
Call TotalLeaveDays
For i = 1 To LeaveDays
dbs.Execute " INSERT INTO tblLeaveProcess " _
        & " Dates VALUES " _
        & "'" + CDate(Me.dtpLeaveFrom + i - 1) + "'"
Next i
       
dbs.Close
End Sub
 
Please advise.
 
Thanks & regards,
 
Rajesh Desai

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Please zip all files prior to uploading to Files section.




SPONSORED LINKS
Microsoft access developer Microsoft access help Microsoft access database
Microsoft access training Microsoft access training course Microsoft access programming


YAHOO! GROUPS LINKS




Reply via email to