JacobLondonUk
New member
- Local time
- Today, 08:42
- Joined
- Nov 25, 2011
- Messages
- 7
i have a table with a date field in it, set as short date, and a field for a NAME
then i have a form with a command button to change the date for a new date which is the beginning of the next week.
i used the following code:
dim TodayDate As Date
dim StrSql as String
TodayDate = Format((Date - Weekday(Date) + 8), "short date")
StrSql = "Insert into MyTable ([DateField], [Name]) Values ( #" & CDate(TodayDate) & "#, '" & Me.Name & "' )"
docmd.runsql StrSql
When i check in the table the date has been changed from the old date to the new date, but the date appears the wrong way around.
if next sunday will be 27/Nov/2011, instead of 27/11/11, it puts in 11/11/27
i tried everything, i am going bizark on that, can anyone help me, will appreciate, thanks
then i have a form with a command button to change the date for a new date which is the beginning of the next week.
i used the following code:
dim TodayDate As Date
dim StrSql as String
TodayDate = Format((Date - Weekday(Date) + 8), "short date")
StrSql = "Insert into MyTable ([DateField], [Name]) Values ( #" & CDate(TodayDate) & "#, '" & Me.Name & "' )"
docmd.runsql StrSql
When i check in the table the date has been changed from the old date to the new date, but the date appears the wrong way around.
if next sunday will be 27/Nov/2011, instead of 27/11/11, it puts in 11/11/27
i tried everything, i am going bizark on that, can anyone help me, will appreciate, thanks