S
Suncobra9
This code will not run. I've tried every way I can think of to fix it, but
nothing's worked. If anyone has any ideas, I'd appretiate it.
Option Compare Database
Option Explicit
Dim strSymbol As String
Dim dteLineDate As Date
Dim intRef As Integer
Dim strSQL As String
Private Sub CopyData()
On Error GoTo Err_CopyData
strSymbol = InputBox("Enter Symbol Code:")
intRef = -63
dteLineDate = DMin("[DATE]""[RAW DATA]", "[SYMBOL] = strSYMBOL")
While intRef < -51
strSQL = "INSERT INTO INTERMEDIATE (SYMBOL, DATE, HIGH," & _
"LOW, LAST, VOLUME) SELECT [RAW DATA].SYMBOL," & _
"[RAW DATA].DATE, [RAW DATA].HIGH, [RAW DATA].LOW, " & _
"[RAW DATA].LAST, [RAW DATA].VOLUME FROM [RAW DATA] " & _
"WHERE ((([RAW DATA].SYMBOL)= strSYMBOL) " & _
"AND (([RAW DATA].DATE)= dteLineDate))"
DoCmd.RunSQL strSQL
intRef = intRef + 1
NextDate:
dteLineDate = dteLineDate + 1
If IsNull (DLookup ("[DATE]","[RAW DATA]", _
"([DATE] = dteLineDate) AND ([SYMBOL] = strSYMBOL)"))
Then GoTo NextDate
Else: End If
Wend
Exit Sub
Err_CopyData:
MsgBox Err.Description
Exit Sub
End Sub
nothing's worked. If anyone has any ideas, I'd appretiate it.
Option Compare Database
Option Explicit
Dim strSymbol As String
Dim dteLineDate As Date
Dim intRef As Integer
Dim strSQL As String
Private Sub CopyData()
On Error GoTo Err_CopyData
strSymbol = InputBox("Enter Symbol Code:")
intRef = -63
dteLineDate = DMin("[DATE]""[RAW DATA]", "[SYMBOL] = strSYMBOL")
While intRef < -51
strSQL = "INSERT INTO INTERMEDIATE (SYMBOL, DATE, HIGH," & _
"LOW, LAST, VOLUME) SELECT [RAW DATA].SYMBOL," & _
"[RAW DATA].DATE, [RAW DATA].HIGH, [RAW DATA].LOW, " & _
"[RAW DATA].LAST, [RAW DATA].VOLUME FROM [RAW DATA] " & _
"WHERE ((([RAW DATA].SYMBOL)= strSYMBOL) " & _
"AND (([RAW DATA].DATE)= dteLineDate))"
DoCmd.RunSQL strSQL
intRef = intRef + 1
NextDate:
dteLineDate = dteLineDate + 1
If IsNull (DLookup ("[DATE]","[RAW DATA]", _
"([DATE] = dteLineDate) AND ([SYMBOL] = strSYMBOL)"))
Then GoTo NextDate
Else: End If
Wend
Exit Sub
Err_CopyData:
MsgBox Err.Description
Exit Sub
End Sub