Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 21st, 2005, 09:59 PM
Friend of Wrox
 
Join Date: Mar 2004
Location: Yorba Linda, California, USA.
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post
Default Can wrong event cause report to not compile?

I have a .mdb with a form that allows the user to select criteria, then it saves the results as a qry to use as record source for a report. The report uses the caption property of the form as the caption on labels in the report header. Both the form and the report run, (or at least they appear to) however, when I try to compile I get a runtime error 2450 "database can't the form "frmpracticeresults referred to in macro or vb code".

I have the following code in the on activate and on report header print events and it scores the same error (2450)on each one of them (but RUNS when I launch from the form).

Reports![rptpracticeresults]![lblSortSpec].Caption = Forms![frmpracticeresults]![lblSortSpec].Caption

I've checked my spelling and frmpracticeresults is present and it runs. Am I perhaps in the wrong event, or did I call it wrong? Or something else?
Any help is much appreciated. I want to get this thing compiled so I can see if we can benefit from splitting.
Thanks,

Loralee


Reply With Quote
  #2 (permalink)  
Old June 22nd, 2005, 10:19 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Put this on the report's header's ON FORMAT event, not in the report's ON ACTIVATE event:

Me.lblSortSpec.Caption = Forms.frmPracticeresults.lblSortSpec.Caption


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #3 (permalink)  
Old June 22nd, 2005, 10:20 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

If that doesn't work, add an extra .Form property, that is...

Me.lblSortSpec.Caption = Forms.frmPracticeresults.Form.lblSortSpec.Caption


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #4 (permalink)  
Old June 22nd, 2005, 10:25 PM
Friend of Wrox
 
Join Date: Mar 2004
Location: Yorba Linda, California, USA.
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks, Greg.

I'll give it a try this week end.
Loralee

Reply With Quote
  #5 (permalink)  
Old June 26th, 2005, 08:58 PM
Friend of Wrox
 
Join Date: Mar 2004
Location: Yorba Linda, California, USA.
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post
Default

Greg,
It looks like just moving the existing code to the Report Header's on FOrmat event, like you said, (and removing the code from the other 2 events) took care of the issue.

THANK YOU very much.

Loralee

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser back button makes wrong event fire Surre ASP.NET 1.0 and 1.1 Professional 1 March 13th, 2006 03:40 PM
What is wrong witht his crystal report code ceema Crystal Reports 0 February 16th, 2006 12:26 AM
Crystal Report displays wrong value. shilpa_net2004 VB Databases Basics 2 December 31st, 2005 12:09 PM
Crystal Report displays wrong value. shilpa_net2004 Crystal Reports 0 December 13th, 2005 04:30 AM
tomcat doesn't report which line is wrong,help,pls ydlei Apache Tomcat 1 May 12th, 2005 09:55 PM



All times are GMT -4. The time now is 12:43 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.