Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I'm a freelance consultant, and your site's helped me with many issues. I just wanted you to know that someone does appreciate the intelligent help your site offers."

Geography

Where in the world do Tek-Tips members come from?

Processing on Events not going like I think it should

bobleonard (Programmer)
26 Apr 12 20:09
Hi,

I'm probably this is my first report that is just coding. Hopefully someone  can enlighten me as to where I went wrong.

I first put the code "Me.A0.value = Str(mylonga)" in the open report event. I get the error: cannot assign a value to this variable. Debug shows I'm reading the correct data in the table.

Next, I move the code to the 'Format Event' in the Detail Section.

If I double-click on the report name, I get the form with no values. But if i do a 'Print Preview' I get the data in the table.
(I can live with this)

This is a report with all unbound text controls. I'll actually get 3 records per page.

The last thing I'm unsure about is: After I get my first three records out. How do I Paginate..to do the next three pages.
Thanks for any help.
BobLeonrd
 
 
dhookom (Programmer)
27 Apr 12 0:01
Why are you not creating reports like 99.9% of all reports which are bound to a query? Aren't you making this way harder than it needs to be?

Duane
Hook'D on Access
MS Access MVP

vbajock (Programmer)
27 Apr 12 10:37
Me.A0.value = Str(mylonga) should be Me!A0.value = Str(mylonga)

 
bobleonard (Programmer)
27 Apr 12 15:20
The change to: Me!A0.value = Str(mylonga) made no difference in open report event or the format report event. In the open report event, I got error-2448, cannot access the variable. It works with the code in the format-event on print-preview. Why? Mine is not to reason why. Consider the following format:

Record1-data Record2-data
Record3-data Record4-data

BL
dhookom (Programmer)
27 Apr 12 16:47
Code doesn't run in all views.

Again

Quote (dhookom):

Why are you not creating reports like 99.9% of all reports which are bound to a query?

 

Duane
Hook'D on Access
MS Access MVP

missinglinq (Programmer)
7 May 12 19:45
You'll get the same error in trying to assign Values to Controls in the Form_Open event, and for the same reason: it's simply too early to be doing this!

I suspect the solution is the same, as well: Move the code to the Report_Load event.

The Missinglinq

Richmond, Virginia

The Devil's in the Details!

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close