I am getting run-time error '2451' (1 Viewer)

venu_resoju

Registered User.
Local time
Today, 17:26
Joined
Dec 29, 2010
Messages
130
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.
 

missinglinq

AWF VIP
Local time
Today, 07:56
Joined
Jun 20, 2003
Messages
6,355
...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)>
 

venu_resoju

Registered User.
Local time
Today, 17:26
Joined
Dec 29, 2010
Messages
130
Yessss............the Report exists and is spelled correctly, but I am getting error when selection is made from the Option Group.
 

missinglinq

AWF VIP
Local time
Today, 07:56
Joined
Jun 20, 2003
Messages
6,355
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)>
 

venu_resoju

Registered User.
Local time
Today, 17:26
Joined
Dec 29, 2010
Messages
130
No..No.. the Report is not in open when the selection is made from the Option Group.
 

missinglinq

AWF VIP
Local time
Today, 07:56
Joined
Jun 20, 2003
Messages
6,355
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)>
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom