473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Refresh a report

Hello,

I've written a module whose output I write to a table. This table's sole
purpose is to be the recordsource for a report. When the report is loaded,
I am running the module on the 'On load' event. When the report first
opens, it looks like it retrieves the records from the table immediately
before the code has run. The code then runs and updates the table but its
too late for the report to have captured those records.

Is there a command I can use in code (at the end of the procedure of course)
to force the report to re-retrieve the records from the table? If so, how
do I reference the report in code?

(as you can tell, I'm not an experienced programmer.. just home taught.)

Thanks,

Gord
Jul 26 '08 #1
2 9319
On Jul 26, 11:25*am, "Gord" <x1gor...@telus.netwrote:
Hello,

I've written a module whose output I write to a table. *This table's sole
purpose is to be the recordsource for a report. *When the report is loaded,
I am running the module on the 'On load' event. *When the report first
opens, it looks like it retrieves the records from the table immediately
before the code has run. *The code then runs and updates the table but its
too late for the report to have captured those records.

Is there a command I can use in code (at the end of the procedure of course)
to force the report to re-retrieve the records from the table? *If so, how
do I reference the report in code?

(as you can tell, I'm not an experienced programmer.. just home taught.)

Thanks,

Gord
I think that after you update the table a me.requery should be all you
need to do.
Jul 26 '08 #2
Sorry, I inadvertently posted this reply back to the individual. (just
delete
it from your e-mail Access) Here is my reply on the newsgroup:

Thanks muchly. That worked great.

There is small glitch that is happening though on this line of code.

When I open the report, my code module runs without a hitch and the last
line 'me.requery' retrieves the records as I wanted. When I click 'Print
Preview', it looks like my code runs again (?) and generates an error
message "Run time error '2467': The expression you entered refers to an
object that is closed or doesn't exist." When I click debug, its stalled on
the 'me.requery' line. When I clear the error box, the report goes on into
print preview just fine so ultimately there doesn't seem to be any real
problem. It's rather annoying though and I don't see why my code module is
running again when all I've done is click on print preview for the report?

Any ideas/suggestions?

Thanks,

Gord

"Access" <al*********@gmail.comwrote in message
news:70**********************************@l42g2000 hsc.googlegroups.com...
On Jul 26, 11:25 am, "Gord" <x1gor...@telus.netwrote:
Hello,

I've written a module whose output I write to a table. This table's sole
purpose is to be the recordsource for a report. When the report is loaded,
I am running the module on the 'On load' event. When the report first
opens, it looks like it retrieves the records from the table immediately
before the code has run. The code then runs and updates the table but its
too late for the report to have captured those records.

Is there a command I can use in code (at the end of the procedure of
course)
to force the report to re-retrieve the records from the table? If so, how
do I reference the report in code?

(as you can tell, I'm not an experienced programmer.. just home taught.)

Thanks,

Gord
I think that after you update the table a me.requery should be all you
need to do.
Jul 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Noel Wood | last post by:
Hello, I have a problem that I'm sure is simple but I have searched the newsgroup and have not found it posted before so I apologize if it has been asked heaps of times before. I have a page that...
1
by: pbb | last post by:
I've got an app I made in asp.net using vb.net and Crystal 9. I use a little javascript to launch a new window (a web form in .net with the Crystal Report Viewer control on it) when the user...
1
by: Sandy | last post by:
We have a web report that times out after 20 minutes if there has been no activity on the report. The timeout is set at the application level and I am unable to get this adjusted. I would like to...
2
by: RipTide | last post by:
Background: Using an unsupported/abandoned multi-user multi-database program that uses Access 97 and Jet 3.5. Program itself appears to have been built with PowerBuilder 6.5. Databases reside on...
2
by: John Baker | last post by:
Hi: I have a Pop Up form that involves a main form and sub form. The sub form has the results of a query on the main form. I need to automatically perform exactly he same action that takes...
2
by: aldous scotch | last post by:
I designed a Crystal Report .rpt from within Microsoft Development Environment 2003 Version 7.1.3088 (VB .NET IDE). I selected database fields from the left side Field Explorer onto the Details...
1
by: Bob | last post by:
I'm asking here because I've posted this question in the crystal newsgroup, waited two weeks, and got zero response. I would be very appreciative if someone could shed some light on this problem...
1
by: Richard Clark | last post by:
I have a page with a MultiView control. The page finishes by running a report (via a page redirect). Because there is often a delay with ReportsServer, I want to display a "final" view of "Report...
3
by: Dave | last post by:
I have an XP database where my users are locked out of the database window. One of my processes creates/drops tables on the fly. My problem is trying to assign one of the new tables to a report. ...
3
by: muddasirmunir | last post by:
I am using VB6 and SQL Server 2000. i want to know how to do this we have two/three computers working in our office sql server is installed in maincomputer where we only see the report do not...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
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,...
0
jinu1996
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.