473,394 Members | 1,841 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,394 software developers and data experts.

report refers to each query row twice when using 'on print' event

I've got a table with one field (id) and one row (id = 1)
I've got a query based on the table that calls a function

select func(id) as idText from table

The function 'func' is

public function func(strId as string) as string
func = strId
end function

If I run the query with a breakpoint on 'func = strId', it gets hit
once

If I create a report based on this query and place the field 'idText'
in the detail portion of the report... the breakpoint above is hit
once when I run the report... so far ... ok
If I add a on-print event
if [idtext]="2" then
stop
end if

the breakpoint in the function above gets hit twice ?
why ?
is there away to prevent this, since my final function will update
global variables that I don't want to double up ???

I thought [idtext] would refer to the report field that already had a
value ...
Nov 12 '05 #1
2 1600
Roger wrote:
If I add a on-print event
if [idtext]="2" then
stop
end if


Why not enter
If [idtext] = "2" then Cancel = True

What is STOP?
Nov 12 '05 #2
the table has only one row with an id of "1"
the function that is called will return 1+1 =2 and I've given this
column an alias of idtext

so "2" doesn't mean it is coming in the second time... in both case
the field contains "2"

but it looks like when referring to the column alias "idtext", it
re-evaluates the function instead of reusing the first computed
result...
by the way "stop" hardcodes a breakpoint in your vba code so you don't
have to find it and hit <f9>

Salad <oi*@vinegar.com> wrote in message news:<3F***************@vinegar.com>...
Roger wrote:
If I add a on-print event
if [idtext]="2" then
stop
end if


Why not enter
If [idtext] = "2" then Cancel = True

What is STOP?

Nov 12 '05 #3

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

Similar topics

1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
2
by: Lloyd Stevens | last post by:
I'm trying to create a report from two queries, one query displays which customers bought a particular product, the quantity and price using the "Enter productID" as parameter While the other is...
9
by: Colin McGuire | last post by:
Hi, I have an report in Microsoft Access and it displays everything in the table. One column called "DECISION" in the table has either 1,2, or 3 in it. On my report it displays 1, 2, or 3. I want...
3
by: Melissa | last post by:
What specifically causes the Format event of a report's section to fire? Thanks! Melissa
6
by: Mike Conklin | last post by:
This one really has me going. Probably something silly. I'm using dcount for a report to determine the number of different types of tests proctored in a semester. My report is based on a...
1
by: Brad | last post by:
Thanks for taking the time to read my question. I have a table of data that has Date, Data and Category. I need to show, in a report, each Categories Data by Date. The Date has to be it's own...
10
by: sara | last post by:
Hi - Is it possible to hide the detail section of a report at run time? I have a report that prints all details, with summary lines. The user would like the report ALSO with just summary lines....
12
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to...
11
by: Gord | last post by:
When I open a certain report, it runs some code that generates the records that will be displayed in that report. This works fine. When I go to print preview the report it appears that the code...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.