Geoff Codd
Registered User.
- Local time
- Today, 18:26
- Joined
- Mar 6, 2002
- Messages
- 190
Too Few Parameters
Hi there,
I have the following code
I keep on getting the error - "Too few parameters expected 2"
Any ideas appreciated
Thanks
Geoff
Hi there,
I have the following code
Code:
Option Compare Database
Option Explicit
Private Sub Create_30_Min_Data()
Dim dbs As DAO.Database
Dim rst1 As DAO.Recordset, rst2 As DAO.Recordset
Dim i As Integer, timevar As Variant
Dim strSQL As String
strSQL = ("SELECT DataProfile.* " _
& " FROM DataProfile " _
& "WHERE (((DataProfile.Point_Id)=10567) " _
& "AND ((DataProfile.Date) Between [Forms]![Report_Criteria_Selection]![Start_Date] And [Forms]![Report_Criteria_Selection]![End_Date]));")
Set dbs = CurrentDb
dbs.Execute "Delete * from tblDataProfile_2"
Set rst1 = dbs.OpenRecordset(strSQL, dbOpenDynaset)
Set rst2 = dbs.OpenRecordset("tblDataProfile_2")
Do While rst1.EOF = False
For i = 0 To 47
With rst2
.AddNew
!DataSet_ID = rst1.Fields(1)
!value1 = rst1.Fields(5 + i)
If rst1.Fields(5 + i).Name = "24:00" Then
![Date] = rst1.Fields(3) + #11:30:00 PM#
Else
timevar = CDate(rst1.Fields(5 + i).Name) - #12:30:00 AM#
![Date] = rst1.Fields(3) + timevar
End If
.Update
End With
Next i
rst1.MoveNext
Loop
Set rst1 = Nothing
Set rst2 = Nothing
Set dbs = Nothing
End Sub
I keep on getting the error - "Too few parameters expected 2"
Any ideas appreciated
Thanks
Geoff
Last edited by a moderator: