I have been using a module for printing labels in Access 97, and
although it works fine, I would like to resolve a minor problem. The
module allows for setting the number of labels to print and/or to
skip; however, the Cancel command button does not function at all, nor
does clicking the X-close. Clicking either one is the same as clicking
the OK button. I have tried virtually everything, but to no avail.
Since the module creates and displays the input box, I assume that I
will need a piece of code to address the issue. A copy of the module
is posted below. Any assistance will be greatly appreciated. Thanks,
Dalan
Option Compare Database
Option Explicit
Dim LabelBlanks&
Dim LabelCopies&
Dim BlankCount&
Dim CopyCount&
Function LabelSetup()
LabelBlanks& = Val(InputBox$("Enter Number of Blank Labels to Skip"))
LabelCopies& = Val(InputBox$("Enter Number of Copies to Print"))
If LabelBlanks& < 0 Then LabelBlanks& = 0
If LabelCopies& < 1 Then LabelCopies& = 1
End Function
Function LabelInitialize()
BlankCount& = 0
CopyCount& = 0
End Function
Function LabelLayout(R As Report)
If BlankCount& < LabelBlanks& Then
R.NextRecord = False
R.PrintSection = False
BlankCount& = BlankCount& + 1
Else
If CopyCount& < (LabelCopies& - 1) Then
R.NextRecord = False
CopyCount& = CopyCount& + 1
Else
CopyCount& = 0
End If
End If
End Function 3 2466
Dalan wrote: I have been using a module for printing labels in Access 97, and although it works fine, I would like to resolve a minor problem. The module allows for setting the number of labels to print and/or to skip; however, the Cancel command button does not function at all, nor does clicking the X-close. Clicking either one is the same as clicking the OK button. I have tried virtually everything, but to no avail.
Since the module creates and displays the input box, I assume that I will need a piece of code to address the issue. A copy of the module is posted below. Any assistance will be greatly appreciated. Thanks, Dalan
Option Compare Database Option Explicit
Dim LabelBlanks& Dim LabelCopies& Dim BlankCount& Dim CopyCount&
Where/when are the functions called. You could do something like
Sub PrintIt()
LabelInitialize
LabelSetup
If msgbox("Do you want to print these labels at this time?",vbQUestion
+ vbYesNo) = vbYes then
'call the report
endif
End Sub Function LabelSetup() LabelBlanks& = Val(InputBox$("Enter Number of Blank Labels to Skip")) LabelCopies& = Val(InputBox$("Enter Number of Copies to Print")) If LabelBlanks& < 0 Then LabelBlanks& = 0
If LabelCopies& < 1 Then LabelCopies& = 1
End Function
Function LabelInitialize() BlankCount& = 0 CopyCount& = 0 End Function
Function LabelLayout(R As Report) If BlankCount& < LabelBlanks& Then R.NextRecord = False R.PrintSection = False BlankCount& = BlankCount& + 1 Else If CopyCount& < (LabelCopies& - 1) Then R.NextRecord = False CopyCount& = CopyCount& + 1 Else CopyCount& = 0 End If End If End Function ot***@safe-mail.net (Dalan) wrote in
news:50**************************@posting.google.c om: I have been using a module for printing labels in Access 97, and although it works fine, I would like to resolve a minor problem. The module allows for setting the number of labels to print and/or to skip; however, the Cancel command button does not function at all, nor does clicking the X-close. Clicking either one is the same as clicking the OK button. I have tried virtually everything, but to no avail.
If you read the Access help file section for Inputbox, you will see
that pressing Cancel returns a zero-length string. You should
immediately test for that condition before testing for legal values,
then gracefully exit the procedure.
Bob Q Since the module creates and displays the input box, I assume that I will need a piece of code to address the issue. A copy of the module is posted below. Any assistance will be greatly appreciated. Thanks, Dalan
Thanks anyway Bob, but I gracefully found an alternate method to
achieve the same results by pressing the once famous DOS key in the
upper left corner. Dalan
Bob Quintal <bq******@generation.net> wrote in message news:<c3******************************@news.terane ws.com>... ot***@safe-mail.net (Dalan) wrote in news:50**************************@posting.google.c om:
I have been using a module for printing labels in Access 97, and although it works fine, I would like to resolve a minor problem. The module allows for setting the number of labels to print and/or to skip; however, the Cancel command button does not function at all, nor does clicking the X-close. Clicking either one is the same as clicking the OK button. I have tried virtually everything, but to no avail.
If you read the Access help file section for Inputbox, you will see that pressing Cancel returns a zero-length string. You should immediately test for that condition before testing for legal values, then gracefully exit the procedure.
Bob Q
Since the module creates and displays the input box, I assume that I will need a piece of code to address the issue. A copy of the module is posted below. Any assistance will be greatly appreciated. Thanks, Dalan
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Csaba2000 |
last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE
5.5+). This should work regardless of whether IE has focus. Normally you would...
|
by: Pete Wilson |
last post by:
How can I highlight the <input type="submit"> object that I want to
highlight?
1. In my form, the user enters his ID. He sees two submit "buttons,"
left labeled Cancel, the right labeled Signup....
|
by: R Bolling |
last post by:
I am using a routine to check to see if a phone number (PK) has alread
been entered, and takes the user to that record if it is found -- as
follows:
Private Sub...
|
by: DBQueen |
last post by:
I am developing an application for a Pathology Lab. There are Batches
(BatchID) which contain multiple Samples (SampleID), and there can be
multiple tests run from the same Sample, thus there can...
|
by: Alan |
last post by:
How do I know the use click the cancel button on the input box ?
| |
by: BabuMan |
last post by:
Hi,
I have a FormView control on a page which is bound to a SQLDataSource table.
Everything works fine except for the "Update". I get an
InvalidCastException. The problem only seems to surface...
|
by: Louis Cypher |
last post by:
I'm working on an application (OEM) using c# that uses input from a keyboard
and a USB Barcode Scanner.
I need to be able to identify keystrokes from the barcode scanner and remove
them from the...
|
by: Jimmy |
last post by:
Quick question for you. I'm using a small form for users to input a range of
dates for a report (similar to the date range forms used in MS templates)
that has an ok and a cancel button. How can I...
|
by: Ciaran |
last post by:
Hi anyone know how to change or even just clear the value of a file
input field using javascript?
document.getElementById('fieldname').value='newvalue';
doesnt work as you would expect.
...
|
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,...
|
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...
| |
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,...
|
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...
|
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: 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: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |