A
AndyB
I have a VBA code like this
' "Calender" is my ActiveX calender
Dim strqry As String
Dim eDate As Date
Dim sdate As Date
eDate = ([Calender] - 27)
sdate = [Calender]
This just checks the variables are set
MsgBox sdate
MsgBox eDate
' DoCmd.OpenQuery qryname
' try putting in SQL direct
strqry = "SELECT [Mytable].* INTO [NewTable]"
strqry = strqry + "FROM [Mytable]"
strqry = strqry + "WHERE ((([Mytable].[Date_Report])>=[sdate] And
([Mytable].[Date_Report])<=[edate]));"
DoCmd.RunSQL strqry
It does not work I get the correct dates from the message box but they are
not carried over to the query.
I even set the DIm to string but it does not work.
What am I missing
Andy
' "Calender" is my ActiveX calender
Dim strqry As String
Dim eDate As Date
Dim sdate As Date
eDate = ([Calender] - 27)
sdate = [Calender]
This just checks the variables are set
MsgBox sdate
MsgBox eDate
' DoCmd.OpenQuery qryname
' try putting in SQL direct
strqry = "SELECT [Mytable].* INTO [NewTable]"
strqry = strqry + "FROM [Mytable]"
strqry = strqry + "WHERE ((([Mytable].[Date_Report])>=[sdate] And
([Mytable].[Date_Report])<=[edate]));"
DoCmd.RunSQL strqry
It does not work I get the correct dates from the message box but they are
not carried over to the query.
I even set the DIm to string but it does not work.
What am I missing
Andy