G
Guest
Hi,
I have the following code and have tried several variations to get the
correct syntax, but to no avail. The section that has the problem is where
the date variable is, because when I take it out, the code works fine. I
tried putting the date into a variable and then using the variable but then
get other errors.
sqlstmt = "SELECT Sum(Storage.Quantity) AS SumOfQuantity " _
& "FROM Storage WHERE ((Storage.Item='" & Me![cboItem] & "' AND " _
& "((Storage.Type)='Input') AND ((Storage.myDate)>= #' &
Me![userDate]& '#)));"
Set Totals = CurrentDb.OpenRecordset(sqlstmt)
Putting double quotes by itself in the middle of the line also gives errors,
hence the single quote by the date field.
I am using Access 2003, XP Pro, SP2 and wrote the function in vba
Any assistance much appreciated.
CathyZ
I have the following code and have tried several variations to get the
correct syntax, but to no avail. The section that has the problem is where
the date variable is, because when I take it out, the code works fine. I
tried putting the date into a variable and then using the variable but then
get other errors.
sqlstmt = "SELECT Sum(Storage.Quantity) AS SumOfQuantity " _
& "FROM Storage WHERE ((Storage.Item='" & Me![cboItem] & "' AND " _
& "((Storage.Type)='Input') AND ((Storage.myDate)>= #' &
Me![userDate]& '#)));"
Set Totals = CurrentDb.OpenRecordset(sqlstmt)
Putting double quotes by itself in the middle of the line also gives errors,
hence the single quote by the date field.
I am using Access 2003, XP Pro, SP2 and wrote the function in vba
Any assistance much appreciated.
CathyZ