473,387 Members | 1,495 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.

Access 2002: Call VB module from reports

D.M
Hello,
Do you know what is the best way to call VB modules from reports.
Thanks in advance.
Nov 12 '05 #1
3 1935
"D.M" <no****@hotmail.com> wrote in news:bs**********@ariane.blic.net:
Hello,
Do you know what is the best way to call VB modules from reports.
Thanks in advance.


Reports are strange animals and where to call procedures may depend on what
the procedure is going to do. One of the more effective ways seems to be to
put the call in the event code of the report or one of its sections. If the
code is to impact the report's recordsource or filter, it may be useful to
set the appropriate property of the report to a call to the procedure, eg:
InputParamaters = GetThisReportsInputParameters()
In ACXP (and greater one assumes) one can set the report's recordset to an
ADO recordset and do some interesting things in the section onformat events,
but this doesn't seem to be documented and it requires some trial and error
work.
--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #2
D.M previously wrote:
Hello,
Do you know what is the best way to call VB modules from reports.
Thanks in advance.

Reports have events and so have event procedures just like every other
object. So in theory coding in reports is no different to coding anywhere
else.
Unfortunately report events occur at uncontrollable and
unpredictable frequencies so your code must be written to produce the
correct answer no matter how many times it might run - which is well nigh
impossible for anything beyond basic assignment and formatting.

Regards

Peter Russell
Nov 12 '05 #3
Certainly, you have to protect yourself from multiple firings of the event
if you are doing calculations. If you are just setting some properties, then
it may not matter if the code is executed more than once (and that is a
common use of code in events -- if FieldX is a certain value, show/don't
show some Text Box by setting its Visible property, for example).

If you want to change the RecordSource of the Report, that must be done in
the Open event.

Larry Linson
Microsoft Access MVP

"Peter Russell" <ru***@127.0.0.1> wrote in message
news:me**********************@russellscott.btinter net.com...
D.M previously wrote:
Hello,
Do you know what is the best way to call VB modules from reports.
Thanks in advance.

Reports have events and so have event procedures just like every other
object. So in theory coding in reports is no different to coding anywhere
else.
Unfortunately report events occur at uncontrollable and
unpredictable frequencies so your code must be written to produce the
correct answer no matter how many times it might run - which is well nigh
impossible for anything beyond basic assignment and formatting.

Regards

Peter Russell

Nov 12 '05 #4

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

Similar topics

6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
5
by: Lakbir Dhillon | last post by:
We converted our databases from Access 97 to Access 2002 (only the MDB files, not the MDW file). In addition we ported the Access application from a Citrix NT server to a Citrix XP server. We...
3
by: Rebecca Smith | last post by:
I’ve been using the code below in Access 97 for years now without any problems at all. Unfortunately, I now have to convert this db to Access 2000. I tried using the conversion feature and that was...
3
by: Jorge Cecílio | last post by:
Hi! I would like to export some MS-Access reports output to pdf. However, the only possibility offered by Access (afaik) for me to export formatted output is snp (snapshot) (I use MS-Office...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
13
by: salad | last post by:
Hi Guys: I was stuck. I needed to send a report to a file. My beautiful report(s) in Access were going to require loss of formatting with RTFs, a PITA in WordMailMerge, sending it as a text...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
10
by: Mike Charney | last post by:
Is there a simple way to send SMTP email from Access VBA? Mike m charney at dunlap hospital dot org
0
by: Lysander | last post by:
Thought I would give something back with a few articles. This article is a bit of code to add error handling. When I have time, I want to write articles on multilingual databases, and Access...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.