473,396 Members | 2,129 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,396 software developers and data experts.

How to use VBA function in Report

Hi,

I wrote a function in VBA, but i'm not sure how to test it to make
sure that my function does what i want it to do.
And how would I call it in Report using the control source? it's
giving me "compile errors" and can i call the function in query?

Thanks. I'd appreciate any help.

Jun 10 '07 #1
1 3972
Hi,

First, a report has a 'record' source not a 'control' source and I do
not know of a way to run a function in the record source but you can
call a function in a reports events like; On Load. On Activate, On
Close
or you can call a function in a Section event like; On Format

To debug your function you can put a stop on it, while on the vba page
of the report click in the left margin next to a line of code and a
red circle should appear, load the report and when it gets to that
spot it will go into debug mode so you can step thru your lines of
code and see if it is functioning as required. When done click on the
red circle to turn it off.
bobh.

On Jun 9, 10:22 pm, Alice <alicey...@gmail.comwrote:
Hi,

I wrote a function in VBA, but i'm not sure how to test it to make
sure that my function does what i want it to do.
And how would I call it in Report using the control source? it's
giving me "compile errors" and can i call the function in query?

Thanks. I'd appreciate any help.

Jun 11 '07 #2

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

Similar topics

4
by: i. dzhugashvili | last post by:
I'm hoping someone can help me here. I'm having problems using a function to get the search criteria for a column in the QBE grid. The column's data type is Long and the problem is that if I...
2
by: Sharon | last post by:
I've had an Access 2000 app running successfully for many months on both Windows XP and Windows 2000. Recently when my Windows 2000 users call a particular report, they get first a dialog...
5
by: deko | last post by:
I'd like to use a bit of code in the OnOpen event of a report: =rptOpen(Me.ReportName), (Me.Tag) --this doesn't work This does work: Private Sub Report_Open(Cancel As Integer)...
3
by: deko | last post by:
I store hyperlinks as text in a table like this: Invoice11-21-2003.pdf#file://P:\Finance\PrefVendors\Receipts\Invoice11-21-20 03.pdf I need to run a report that lists the documents - or...
1
by: Peter | last post by:
Dear all, Could you give me a hint? a) I generate a report from a query table, then I want to use this report to show the total numbers of the customers who buy the goods. There is a string...
2
by: ThompsonJessical | last post by:
I am trying to use a button with the vba coding for SendObject Function to email a specific report based on the value of another field of the current record. The form is a continuous form and...
1
by: Kapil Shah via DotNetMonster.com | last post by:
Hello Everybody, I am trying to write a crystal report function which should return a value of 1 for crystal report with no parameter and return a value 2 for crystal report with parameter. ...
0
by: aakash | last post by:
Hello Guys I am upsizing ms access project to give it a ms sql connectivity I am having problem in accessing form control values in ms sql function CREATE FUNCTION "ReportList DateRange"() ...
36
by: bmyers | last post by:
Good afternoon, I am attempting to count only those records within a report, which is based on a query, where Status is equal to Closed. I have tried multiple variations of DCOUNT but am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.