Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-21-2011, 06:27 AM   #1
venu_resoju
Newly Registered User
 
Join Date: Dec 2010
Posts: 130
Thanks: 3
Thanked 0 Times in 0 Posts
venu_resoju is on a distinguished road
I am getting run-time error '2451'

Hai Friends,

I have a report named "EPFChallan" and also I have created a option group on a form named "Records" and given a code like below

Private Sub Frame86_AfterUpdate()
Select Case Frame86.Value
Case 1

Reports!EPFChallan!txtmonth1 = Forms!records!cbomonth
Reports!EPFChallan!txtYear1 = Forms!records!cbomonth

Case 2
Reports!EPFChallan!txtmonth1 = Mtxtmonth
Reports!EPFChallan!txtYear = Mtxtyear
Reports!EPFChallan!totalsubscribers = txtemplys
Reports!EPFChallan!TotalWages = txtwages


End Select

End Sub

but I am getting a Run-Time error '2451' which stated that "The report name "EPFChallan" you entered is misspelled or refers to a report that isn't open or doesn't exist"

the report name is spelled correct but why is it happening like this? what's wrong with me ?

Please any body tell me.....thanks in advance.

venu_resoju is offline   Reply With Quote
Old 08-21-2011, 07:54 AM   #2
missinglinq
AWF VIP
 
missinglinq's Avatar
 
Join Date: Jun 2003
Location: Richmond (Virginia that is!)
Posts: 6,079
Thanks: 11
Thanked 660 Times in 621 Posts
missinglinq is just really nice missinglinq is just really nice missinglinq is just really nice missinglinq is just really nice missinglinq is just really nice
Re: I am getting run-time error '2451'

Quote:
Originally Posted by venu_resoju View Post
...I am getting a Run-Time error '2451' which stated that "The report name "EPFChallan" you entered is misspelled or refers to a report that isn't open or doesn't exist"
So the Report exists and is spelled correctly, but is the Report open when the selection is made from the Option Group?

Linq ;0)>
__________________
The Devil's in the Details!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


(All code solutions tested in Access 2003/2007, before posting, unless otherwise noted.)
missinglinq is offline   Reply With Quote
Old 08-21-2011, 08:18 AM   #3
venu_resoju
Newly Registered User
 
Join Date: Dec 2010
Posts: 130
Thanks: 3
Thanked 0 Times in 0 Posts
venu_resoju is on a distinguished road
Re: I am getting run-time error '2451'

Yessss............the Report exists and is spelled correctly, but I am getting error when selection is made from the Option Group.

venu_resoju is offline   Reply With Quote
Old 08-21-2011, 04:15 PM   #4
missinglinq
AWF VIP
 
missinglinq's Avatar
 
Join Date: Jun 2003
Location: Richmond (Virginia that is!)
Posts: 6,079
Thanks: 11
Thanked 660 Times in 621 Posts
missinglinq is just really nice missinglinq is just really nice missinglinq is just really nice missinglinq is just really nice missinglinq is just really nice
Re: I am getting run-time error '2451'

Quote:
Originally Posted by venu_resoju View Post
Yessss............the Report exists and is spelled correctly, but I am getting error when selection is made from the Option Group.
You still haven't answered my question:

"...is the Report open when the selection is made from the Option Group?"

You cannot reference a Control on a Report or a Form unless the Report or Form is Open at the time.

Linq ;0)>
__________________
The Devil's in the Details!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


(All code solutions tested in Access 2003/2007, before posting, unless otherwise noted.)
missinglinq is offline   Reply With Quote
Old 08-23-2011, 03:58 AM   #5
venu_resoju
Newly Registered User
 
Join Date: Dec 2010
Posts: 130
Thanks: 3
Thanked 0 Times in 0 Posts
venu_resoju is on a distinguished road
Re: I am getting run-time error '2451'

No..No.. the Report is not in open when the selection is made from the Option Group.
venu_resoju is offline   Reply With Quote
Old 08-23-2011, 08:02 AM   #6
missinglinq
AWF VIP
 
missinglinq's Avatar
 
Join Date: Jun 2003
Location: Richmond (Virginia that is!)
Posts: 6,079
Thanks: 11
Thanked 660 Times in 621 Posts
missinglinq is just really nice missinglinq is just really nice missinglinq is just really nice missinglinq is just really nice missinglinq is just really nice
Re: I am getting run-time error '2451'

Quote:
Originally Posted by venu_resoju View Post
No..No.. the Report is not in open when the selection is made from the Option Group.
Well, there's your answer! The error message you reported was:

"The report name "EPFChallan" you entered is misspelled or refers to a report that isn't open or doesn't exist"

The Report has to be open before assigning values to Controls on it. A Report reflects the data at the time it is opened. A closed Report, in essence, has no data in it, and no data can be assigned to it.

Linq ;0)>
__________________
The Devil's in the Details!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


(All code solutions tested in Access 2003/2007, before posting, unless otherwise noted.)
missinglinq is offline   Reply With Quote
Old 08-23-2011, 08:42 AM   #7
venu_resoju
Newly Registered User
 
Join Date: Dec 2010
Posts: 130
Thanks: 3
Thanked 0 Times in 0 Posts
venu_resoju is on a distinguished road
Re: I am getting run-time error '2451'

I am here with attaching a Sample DB.
Attached Files
File Type: mdb Sample DB.mdb (628.0 KB, 127 views)


venu_resoju is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Time Error 9 , trying to save Excel file, on 2nd time through loop heron_rider Modules & VBA 2 05-31-2011 10:20 AM
Error 2451 RandomQuestions Queries 4 02-16-2010 12:43 AM
Run time error 3075 - syntax error (missing operator) in query expression puskardas Modules & VBA 8 06-30-2008 07:35 PM
Run timer error 2451 arage Modules & VBA 2 07-05-2002 09:39 AM
Error Messages 2451 and 2465 sdiehl Modules & VBA 1 02-06-2002 02:28 PM




All times are GMT -8. The time now is 12:58 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World