E
Eric
Why it gives error when i try to insert data:
Invalid Argument
---------------------------------------------------------------------------------------------------------------
Dim arr(99)
Dim qry As String, rst As Object
qry = "SELECT tbl_EquipmentChronology.Equipment1 FROM
tbl_EquipmentChronology INNER JOIN tbl_events ON
tbl_events.TicketNum=tbl_EquipmentChronology.TicketNum where
tbl_events.TicketNum=" &
Forms!tbl_PPVResearch_Edit!frm_Events!TicketNum & " and
tbl_events.PPVVOD_Outlet=tbl_EquipmentChronology.Outlet"
Set rst = CurrentDb.OpenRecordset(qry)
rst.MoveFirst
Do While Not rst.EOF
arr(i) = rst!Equipment1
i = i + 1
' Text2.Value = rst!Equipment1
rst.MoveNext
Loop
Dim qry2 As String, rst2 As Object
For i = 0 To 100
If arr(i) <> "" Then
ss = arr(i)
qry2 = "insert into equipm(equip) values('" & ss & "')"
Set rst2 = CurrentDb.OpenRecordset(qry2)
End If
Next
----------------------------------------------
Invalid Argument
---------------------------------------------------------------------------------------------------------------
Dim arr(99)
Dim qry As String, rst As Object
qry = "SELECT tbl_EquipmentChronology.Equipment1 FROM
tbl_EquipmentChronology INNER JOIN tbl_events ON
tbl_events.TicketNum=tbl_EquipmentChronology.TicketNum where
tbl_events.TicketNum=" &
Forms!tbl_PPVResearch_Edit!frm_Events!TicketNum & " and
tbl_events.PPVVOD_Outlet=tbl_EquipmentChronology.Outlet"
Set rst = CurrentDb.OpenRecordset(qry)
rst.MoveFirst
Do While Not rst.EOF
arr(i) = rst!Equipment1
i = i + 1
' Text2.Value = rst!Equipment1
rst.MoveNext
Loop
Dim qry2 As String, rst2 As Object
For i = 0 To 100
If arr(i) <> "" Then
ss = arr(i)
qry2 = "insert into equipm(equip) values('" & ss & "')"
Set rst2 = CurrentDb.OpenRecordset(qry2)
End If
Next
----------------------------------------------