472,325 Members | 1,332 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Input Box Fails to Cancel

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
Nov 12 '05 #1
3 2414
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


Nov 12 '05 #2
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

Nov 12 '05 #3
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

Nov 12 '05 #4

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

Similar topics

4
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...
3
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...
2
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...
0
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...
9
by: Alan | last post by:
How do I know the use click the cancel button on the input box ?
1
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...
1
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...
4
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...
4
by: Ciaran | last post by:
Hi anyone know how to change or even just clear the value of a file input field using javascript? ...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

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.