Predmet:Re: Syntax error in date in query
greska je u ovoj proceduri.
Evo samo moju zamijeni sa postojecom.
PreuzmiIzvorni kôd (Visual Basic):Sub P_InsertDate(PDT As Date)
' Inserts Date/Chair/TimeSlot Values In Table T_Plan
On Error GoTo ErrTrap
Dim QST As String
Dim Datum As String
Datum = "#" & Format(PDT, "mm-dd-yyyy") & "#"
If DCount("*", "T_Plan", "PDate =" & Datum) > 0 Then
GoTo ExitPoint ' This Date Already Exists
End If
QST = "INSERT INTO T_Plan (PDate, TimeSlot) " & _
" SELECT " & Datum & " AS PDate, TimeSlot " & _
" FROM T_TimeSlot ;"
DoCmd.SetWarnings False
DoCmd.RunSQL QST
DoCmd.SetWarnings True
ExitPoint:
On Error GoTo 0
Exit Sub
ErrTrap:
MsgBox Err.Description
Resume ExitPoint
End Sub
Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.