G
Guest
I have an SQL statement that gets some of its values from a form and some
from a variable in the code. the statement is as follows:
SELECT tblPublicTaken.EmpNo, tblPublicTaken.Year, tblPublicTaken.Holiday,
tblPublicTaken.ActualDate, tblPublicTaken.TakenOnDay, tblPublicTaken.Lieu
FROM tblPublicTaken WHERE (((tblPublicTaken.EmpNo) =16) And
((tblPublicTaken.ActualDate) = #25/12/06#))
The number 16 comes from a variable and the date comes from a field on a
form. The actual statement is:
strPublic = "SELECT tblPublicTaken.EmpNo, tblPublicTaken.Year,
tblPublicTaken.Holiday, tblPublicTaken.ActualDate, tblPublicTaken.TakenOnDay,
tblPublicTaken.Lieu FROM tblPublicTaken WHERE (((tblPublicTaken.EmpNo) =" &
intEmpNo & ") And ((tblPublicTaken.ActualDate) = #" &
[Forms]![frmDepartmentUpdate].[Text0] & "#))"
But for some reason this dosn't work. I tried cutting the value and pasting
it directly into the SQL builder of a normal Access query. The first
statement above is how it looks in the SQL view of the query, but if I change
the view to design the date changes from #25/12/06# to #06/12/25#
Why is this happening? The field on the form is not linked to a field.
from a variable in the code. the statement is as follows:
SELECT tblPublicTaken.EmpNo, tblPublicTaken.Year, tblPublicTaken.Holiday,
tblPublicTaken.ActualDate, tblPublicTaken.TakenOnDay, tblPublicTaken.Lieu
FROM tblPublicTaken WHERE (((tblPublicTaken.EmpNo) =16) And
((tblPublicTaken.ActualDate) = #25/12/06#))
The number 16 comes from a variable and the date comes from a field on a
form. The actual statement is:
strPublic = "SELECT tblPublicTaken.EmpNo, tblPublicTaken.Year,
tblPublicTaken.Holiday, tblPublicTaken.ActualDate, tblPublicTaken.TakenOnDay,
tblPublicTaken.Lieu FROM tblPublicTaken WHERE (((tblPublicTaken.EmpNo) =" &
intEmpNo & ") And ((tblPublicTaken.ActualDate) = #" &
[Forms]![frmDepartmentUpdate].[Text0] & "#))"
But for some reason this dosn't work. I tried cutting the value and pasting
it directly into the SQL builder of a normal Access query. The first
statement above is how it looks in the SQL view of the query, but if I change
the view to design the date changes from #25/12/06# to #06/12/25#
Why is this happening? The field on the form is not linked to a field.