Hi,
This is an issue that has only appeared this week and I cant figure out why. Below is a snippet of the code that I use, the user is promoters for a week, this has always worked and still does for any number less than 245. I dont know if 246 will work yet as I dont have that data.
Is there anything that would cause an integer with value 245 not to work? The query does still return values when I run it manually with value 245 and the strings for the query are all correct, hence why it works perfectly until you try and run it for week 245.
I appreciate the help on this, its driving me mad!
This is an issue that has only appeared this week and I cant figure out why. Below is a snippet of the code that I use, the user is promoters for a week, this has always worked and still does for any number less than 245. I dont know if 246 will work yet as I dont have that data.
Is there anything that would cause an integer with value 245 not to work? The query does still return values when I run it manually with value 245 and the strings for the query are all correct, hence why it works perfectly until you try and run it for week 245.
I appreciate the help on this, its driving me mad!
Code:
' Excel Objects:
Dim objXL As Excel.Application
Dim objWBK As Excel.Workbook
Dim objWS As Excel.Worksheet
Dim objRNG As Excel.Range
' DAO objects:
Dim objDB As DAO.Database
Dim objQDF As DAO.QueryDef
Dim objRS As DAO.Recordset
Set objDB = CurrentDb()
Set objXL = New Excel.Application
Set objWBK = objXL.Workbooks.Open(strcXLPath)
'Display Excel Now Copying Is Complete
objXL.Visible = True
Set objQDF = objDB.QueryDefs(queryWeek)
With objDB.QueryDefs(queryWeek)
.Parameters("Enter Week") = 245
End With
Set objRS = objQDF.OpenRecordset
Set objWS = objWBK.Worksheets("Sheet1")
Set objRNG = objWS.Range("B3")
objRNG.CopyFromRecordset objRS
Last edited: