G
Guest
Nikos,
The following is my code and the date format in my listbox is dd/mm/yyyy,
same with all other dates in my db. the code includes the original that you
sent me.
thanks again Nikos
Dim strSQL As String
Date1 = Me.lsbxAvailableEmployees.Column(1)
vYear = Val(Left(Date1, 2))
vMonth = Val(Mid(Date1, 4, 2))
vDay = Val(Right(Date1, 2))
Date2 = DateSerial(vYear, vMonth, vDay)
strSQL = "INSERT INTO tblAllocation ( OrderID, EmployeeID, Startdate,
Duration )"
strSQL = strSQL & " SELECT " & Me.cmbxOutstandingOrders
strSQL = strSQL & " , " & Me.lsbxAvailableEmployees.Column(0)
strSQL = strSQL & " , " & Date2
strSQL = strSQL & " , " & Me.lsbxAvailableEmployees.Column(2)
DoCmd.RunSQL strSQL
Date1 = Me.lsbxAvailableEmployees.Column(1)
Date2 = DateSerial(Year(Date1), Month(Date1), Day(Date1))
strSQL = "DELETE * FROM tblEmployeeAvailability"
strSQL = strSQL & " WHERE EmployeeID = " & Me.lsbxAvailableEmployees.Column(0)
strSQL = strSQL & " AND StartDate = #" & Date2 & "#"
DoCmd.RunSQL strSQL
The following is my code and the date format in my listbox is dd/mm/yyyy,
same with all other dates in my db. the code includes the original that you
sent me.
thanks again Nikos
Dim strSQL As String
Date1 = Me.lsbxAvailableEmployees.Column(1)
vYear = Val(Left(Date1, 2))
vMonth = Val(Mid(Date1, 4, 2))
vDay = Val(Right(Date1, 2))
Date2 = DateSerial(vYear, vMonth, vDay)
strSQL = "INSERT INTO tblAllocation ( OrderID, EmployeeID, Startdate,
Duration )"
strSQL = strSQL & " SELECT " & Me.cmbxOutstandingOrders
strSQL = strSQL & " , " & Me.lsbxAvailableEmployees.Column(0)
strSQL = strSQL & " , " & Date2
strSQL = strSQL & " , " & Me.lsbxAvailableEmployees.Column(2)
DoCmd.RunSQL strSQL
Date1 = Me.lsbxAvailableEmployees.Column(1)
Date2 = DateSerial(Year(Date1), Month(Date1), Day(Date1))
strSQL = "DELETE * FROM tblEmployeeAvailability"
strSQL = strSQL & " WHERE EmployeeID = " & Me.lsbxAvailableEmployees.Column(0)
strSQL = strSQL & " AND StartDate = #" & Date2 & "#"
DoCmd.RunSQL strSQL