When i copy data form to multiple form i get a "Run-time error 3021. No current record " in the line "rst2.MoveLast"...Can you help me out... -
Private Sub Process_AfterUpdate()
-
Dim db As DAO.Database
-
Dim rst11 As DAO.Recordset
-
Dim rst10 As DAO.Recordset
-
Dim rst9 As DAO.Recordset
-
Dim rst8 As DAO.Recordset
-
Dim rst7 As DAO.Recordset
-
Dim rst6 As DAO.Recordset
-
Dim rst5 As DAO.Recordset
-
Dim rst4 As DAO.Recordset
-
Dim rst3 As DAO.Recordset
-
Dim rst2 As DAO.Recordset
-
Dim rst1 As DAO.Recordset
-
-
Set rst11 = Forms!frm_BIA!frm_jobtraing.Form.RecordsetClone
-
Set rst10 = Forms!frm_BIA!frm_Vtlrcrd.Form.RecordsetClone
-
Set rst9 = Forms!frm_BIA!frm_off_telrequ.Form.RecordsetClone
-
Set rst8 = Forms!frm_BIA!frm_othrasset.Form.RecordsetClone
-
Set rst7 = Forms!frm_BIA!frm_sffreq.Form.RecordsetClone
-
Set rst6 = Forms!frm_BIA!frm_essintrcntrct_con.Form.RecordsetClone
-
Set rst5 = Forms!frm_BIA!frm_mnulprcdre.Form.RecordsetClone
-
Set rst4 = Forms!frm_BIA!frm_resorcsrequrmnt.Form.RecordsetClone
-
Set rst3 = Forms!frm_BIA!frm_endtoendprcs.Form.RecordsetClone
-
Set rst2 = Forms!frm_BIA!frm_prcscrticl_crtria_crtocatybase.Form.RecordsetClone
-
Set rst1 = Forms!frm_BIA!frm_SignOff.Form.RecordsetClone
-
-
'find the current record
-
'rst1.FindFirst "ID = " & Me.ID
-
-
rst2.MoveLast
-
Do While Not rst2.EOF
-
If rst2.AbsolutePosition = rst1.AbsolutePosition Then
-
rst2.Edit
-
rst2!Process = Me.Process
-
rst2.Update
-
rst3.Edit
-
rst3!Process = Me.Process
-
rst3.Update
-
rst4.Edit
-
rst4!Process = Me.Process
-
rst4.Update
-
rst5.Edit
-
rst5!Process = Me.Process
-
rst5.Update
-
rst6.Edit
-
rst6!Process = Me.Process
-
rst6.Update
-
rst7.Edit
-
rst7!Process = Me.Process
-
rst7.Update
-
rst8.Edit
-
rst8!Process = Me.Process
-
rst8.Update
-
rst9.Edit
-
rst9!Process = Me.Process
-
rst9.Update
-
rst10.Edit
-
rst10!Process = Me.Process
-
rst10.Update
-
rst11.Edit
-
rst11!Process = Me.Process
-
rst11.Update
-
-
Exit Do
-
Else
-
rst2.MoveNext
-
rst3.MoveNext
-
rst4.MoveNext
-
rst5.MoveNext
-
rst6.MoveNext
-
rst7.MoveNext
-
rst8.MoveNext
-
rst9.MoveNext
-
rst10.MoveNext
-
rst11.MoveNext
-
-
End If
-
Loop
-
rst1.Close
-
rst2.Close
-
rst3.Close
-
rst4.Close
-
rst5.Close
-
rst6.Close
-
rst7.Close
-
rst8.Close
-
rst9.Close
-
rst10.Close
-
rst11.Close
-
-
Set rst1 = Nothing
-
Set rst1 = Nothing
-
-
End Sub
7 5928 NeoPa 32,556
Expert Mod 16PB
Joseph, why don't you strip out all the irrelevant code from this (most of it) and come back with a question that's clearly asked and pertaining to the problem code only.
I expect once you tidy it up a bit your problem will become obvious anyway.
i have 5 subform , when i enter data in subform 1 it should copy data to subform 2 to subform 5. when i write this code it was working fine, but now i get a error message "Run-time error 3021. No current record" - Private Sub Process_AfterUpdate()
-
Dim db As DAO.Database
-
Dim rst3 As DAO.Recordset
-
Dim rst2 As DAO.Recordset
-
Dim rst1 As DAO.Recordset
-
-
-
Set rst3 = Forms!frm_BIA!frm_endtoendprcs.Form.RecordsetClone
-
Set rst2 = Forms!frm_BIA!frm_prcscrticl_crtria_crtocatybase.Form.RecordsetClone
-
Set rst1 = Forms!frm_BIA!frm_SignOff.Form.RecordsetClone
-
-
'find the current record
-
'rst1.FindFirst "ID = " & Me.ID
-
-
rst2.MoveLast
-
Do While Not rst2.EOF
-
If rst2.AbsolutePosition = rst1.AbsolutePosition Then
-
rst2.Edit
-
rst2!Process = Me.Process
-
rst2.Update
-
rst3.Edit
-
rst3!Process = Me.Process
-
rst3.Update
-
-
Exit Do
-
Else
-
rst2.MoveNext
-
rst3.MoveNext
-
-
-
End If
-
Loop
-
rst1.Close
-
rst2.Close
-
rst3.Close
-
-
Set rst1 = Nothing
-
Set rst1 = Nothing
-
-
End Sub
NeoPa 32,556
Expert Mod 16PB
This has got even less explanation in than the first attempt, but I see you've stripped some code out, so I'll take it that you're trying at least.
Now I've added the CODE tags again for you, can you tell me which line (post the number) is highlighted when the error comes up?
NeoPa 32,556
Expert Mod 16PB
Looking at it some more I think maybe your form setup might be a problem. Your references certainly appear to be.
Please do as asked in my post #2 and explain what is going on with your forms. What is a subform of what, and what are the names of the SubForm controls where they are used, and which forms are these controls on?
Remember, it's your job to post the question. If you can't spend the effort to post the information properly then I'm not going to waste much more time on this.
To precise it more....
Main form - frm_BIA
Subform - frm_endtoendprcs
Subform - frm_prcscrticl_crtria_crtocatybase
Subform - frm_SignOff
In frm_SignOff I have a field name process, when i enter the process name in Signoff, the process detail should display in other subform frm_endtoendprcs and frm_prcscrticl_crtria_crtocatybase.
when i run the code Afterupdate in frm_SignOff - Process field. i get the error message in "rst2.MoveLast" line.
OK in simple terms.
This subform (frm_BIA!frm_prcscrticl_crtria_crtocatybase) does not contain any records.
The only reason you would be getting this error on rs2.MoveLast is if there are no records in this recordset.
You need to figure out why there are no records.
NeoPa 32,556
Expert Mod 16PB
I suppose you are under the impression you have answered the questions asked in my post, yet a quick check shows that subform control names are still missing. There is also no information related to what data is associated with any of your forms. I'm afraid that with that level of care (not even providing the specific info requested, let alone all relevant info), even after being reminded, I'm not interested in spending any more time on this than I already have.
Mary's post is correct of course. That should be enough to start you in the right direction. We could have been so much more help with the information posted though I expect.
Good luck with your project.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: James |
last post by:
Hi,
I would like to run a custom script on a linux box via a button on a php
page (php webpage hosted on the same linux box).
Is this possible? If so , can you give me a pointer in the right...
|
by: hakim |
last post by:
Hi,
I need some information ?
How I can run my project (Php) on CGI.
Thanks.
|
by: Dica |
last post by:
i'm just learning java now, so this might be obvious, but not to me.
my app needs to do two things:
(1) connect to and fetch a list of tasks for a user from a web service
(2) connect to mapquest...
|
by: leroybt.rm |
last post by:
Can someone tell me how to run a script from a interactive shell
I type the following:
>>>python filename
>>>python filename.py
>>>run filename
>>>run filename.py
>>>/run filename
>>>/run...
|
by: Ed |
last post by:
Hello,
I took a course in asp about 2 years ago and I was
practicing with IIS 5.0. Then I put it down for a while.
Now trying to get back to it. I can't run asp files from
subdirectories of...
|
by: orekin |
last post by:
Hi There
I have been trying to come to grips with Application.Run(),
Application.Exit() and the Message Pump and I would really appreciate
some feedback on the following questions .. There are...
|
by: Bob Day |
last post by:
Using vs2003, vb.net
I start a thread, giving it a name before start. Code snippet:
'give each thread a unique name (for later identification)
Trunk_Thread.Name = "Trunk_0_Thread"
' allow...
|
by: Brett Wesoloski |
last post by:
I am new to VS2005.
I changed my program.cs file to be a different form I am working on. But
when I go to run the application it still brings up the form that was
originally declared as new. ...
|
by: David Thielen |
last post by:
Hi;
In our setup program how do I determine if I need to run "aspnet_regiis –i"
and if so, is there an API I can calll rather than finding that program on
the user's disk and calling it?
--...
|
by: traceable1 |
last post by:
Is there a way I can set up a SQL script to run when the instance
starts up?
SQL Server 2005 SP2
thanks!
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |