B
Barnabas Mudri
Hi,
I'd like update the table in the opened form and some other tables too by
recordset too.
After I update the data on the form - line 16 - I get an error at line 18 -
Method 'MoveNext' of object 'Recordset' failed
If I delete line 16 it works. why?
thx
Barna
------
1 Dim sz2 As String
2 Dim i As Long
3 Dim aa
4 Dim rs2 As ADODB.Recordset
5 Set rs2 = New ADODB.Recordset
6 i = 2
7 rs.Close
8 Form_SZAMLA_sorok.Recordset.MoveFirst
9 Do
10 If Form_SZAMLA_sorok.szamlazva Then
11 sz2 = "SELECT * FROM MOZGAS"
12 rs2.Open sz2, CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
13 aa = Array(Str(Form_SZAMLA.sz_datum), Str(Form_SZAMLA_sorok.m_aruID),
Str(2), Str(Form_SZAMLA.sz_vevo), Str(Form_SZAMLA_sorok.sz_rID),
Str(Form_SZAMLA_sorok.db))
14 rs2.AddNew Array("datum", "aruID", "mozgasID", "vevoID", "rID", "db"),
aa
15 rs2.Close
16 Form_SZAMLA_sorok.sz_szID = i
17 End If
18 Form_SZAMLA_sorok.Recordset.MoveNext
20 Loop Until Form_SZAMLA_sorok.Recordset.EOF
I'd like update the table in the opened form and some other tables too by
recordset too.
After I update the data on the form - line 16 - I get an error at line 18 -
Method 'MoveNext' of object 'Recordset' failed
If I delete line 16 it works. why?
thx
Barna
------
1 Dim sz2 As String
2 Dim i As Long
3 Dim aa
4 Dim rs2 As ADODB.Recordset
5 Set rs2 = New ADODB.Recordset
6 i = 2
7 rs.Close
8 Form_SZAMLA_sorok.Recordset.MoveFirst
9 Do
10 If Form_SZAMLA_sorok.szamlazva Then
11 sz2 = "SELECT * FROM MOZGAS"
12 rs2.Open sz2, CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
13 aa = Array(Str(Form_SZAMLA.sz_datum), Str(Form_SZAMLA_sorok.m_aruID),
Str(2), Str(Form_SZAMLA.sz_vevo), Str(Form_SZAMLA_sorok.sz_rID),
Str(Form_SZAMLA_sorok.db))
14 rs2.AddNew Array("datum", "aruID", "mozgasID", "vevoID", "rID", "db"),
aa
15 rs2.Close
16 Form_SZAMLA_sorok.sz_szID = i
17 End If
18 Form_SZAMLA_sorok.Recordset.MoveNext
20 Loop Until Form_SZAMLA_sorok.Recordset.EOF