I have a label that needs to print out when a part comes in, but I want a message box to pop up to ask how many copies of the label do they want to print. This is my code so far. Where the Docmd.Print is, I have 2 for the copies, but I want a message box that the user will enter how many they want. - Private Sub Command32_Click()
-
'Open report in Preview mode
-
DoCmd.OpenReport "Labels Part Labels Dymo", acViewPreview
-
'Print out specified number of report copies
-
DoCmd.PrintOut , , , , 2
-
End Sub
4 2280 Laharl 849
Recognized Expert Contributor
This is in the wrong place, perhaps you wanted the Visual Basic forum?
acoder 16,027
Recognized Expert Moderator MVP
Moved to the Visual Basic forum. The Feedback forum is not for technical questions. Please use the most relevant forum for your question. Also remember to enclose your code in code tags.
Moderator.
is this an Access Database you have or visual basic, because a "DoCmd" is in MS Access i have never seen it done in visual basic 6
lee123
Please specify what kind of VB are you using (MS Office or VB IDE). Choices I would implement:
1) Create your custom dialog box, then create a PUBLIC variable (Public copyNumber as Integer), and then pass the number of copies to the main window through the global variable (the one you set to Public) after you showed the Dialog form and got some input from the user.
2) Set a variable and use the InputBox("","") function to get a value for the variable. Supposing you don't have VB 6 (IDE) and Office follows most of VB 5/6: - Public copyNumber as Integer
-
Private Sub Command32_Click()
-
'Open report in Preview mode
-
DoCmd.OpenReport "Labels Part Labels Dymo", acViewPreview
-
'Ask for # of copies
-
frmAsk.show()
-
'frmAsk is the custom dialog form created for option 1.
-
'If you can't use .show(), try .visible = true
-
'Print out specified number of report copies
-
'Pass the number of copies
-
DoCmd.PrintOut , , , , copyNumber
-
End sub
Supposing you have VB IDE: - Private Sub Command32_Click()
-
'Open report in Preview mode
-
DoCmd.OpenReport "Labels Part Labels Dymo", acViewPreview
-
'Ask for # of copies
-
Dim i as Integer
-
'The function InputBox is in VB 6 but I don't know if it is in VB for Office (try it anyways)
-
i = InputBox("Replace with Prompt", "Replace with Title for the Dialog Box")
-
'Print out specified number of report copies
-
'Pass the number of copies
-
DoCmd.PrintOut , , , , i
-
End sub
I really hope ou got your answer.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Nathan Pinno |
last post by:
Hi all,
I need help figuring out how to fix my code. I'm using Python 2.2.3, and
it keeps telling me invalid syntax in the if name == "Nathan" line. Here is
the code if you need it.
#This program asks for a password, then asks for the user's name after the
correct password has been supplied. The computers response will vary,
# depending on the name inputted.
print "Program Author: Nathan Pinno"
|
by: Bernard |
last post by:
Hi,
I have a problem with a CGI script (Perl) on a Win2000 server.
The script is for sending E-cards and was written by Jason Maloney:
http://www.aestheticsurgerycenter.com/scripts/postcard/postcard1.shtml
You can choose from some cards, add your own text and send it to a friend.
This friend get a mail which tell him/her that he/she has a mail and have to
click a link.
So far everything works just fine.
But when the recipient clicks...
|
by: FLOTServer |
last post by:
Here's my problem: I run a gameserver that runs the game "Medal of Honor".
On the game server is log file which contains all of the data from the
players for that day (kills, deaths, etc...). I have a perl script that runs
on my webserver, which is supposed to login to the gameserver and download
the log. The problem is that when it gets to the part where it needs to
download the file, it aborts. The gameserver FTP requires I use port 24...
|
by: Chris |
last post by:
Hi,
I found this code that can solve a problem I have. It sends print direct to
printer.
Imports System
Imports System.Text
Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential)> _
Public Structure DOCINFO<MarshalAs(UnmanagedType.LPWStr)>
|
by: Neal |
last post by:
Hi,
I saw the VB6 Code to do this at this link:
http://www.dotnet247.com/247reference/msgs/11/56581.aspx
The VB6 Code reads as follows:
Private Type Rect
Left As Long
| |
by: Keith Kowalski |
last post by:
I anm opening up a text file reading the lines of the file that refer to a
tif image in that file, If the tif image does not exist I need it to send an
email stating that the file doesn't exist then skip this file and move onto
the next file (line).
If file is there then move to a sirectory.
Here is the code I have (Feel free to make corrections as needed. If
possible make changes in red)
|
by: Benny |
last post by:
The methods within an interface is not virtual.
How do I go about doing the following:
class BaseClass : IComparable
{
int CompareTo(Object o) {...}
};
class DerivedClass : BasedClass
{
|
by: Gasten |
last post by:
Hello.
The last weeks I've been coding a roguelike (you know, like nethack) in
python using the nCurses library. Some week ago I ran into a problem:
When I made the object for messagebar-output, I found a bug that I
can't figure out (believe me; I've tried everything and asked for help
several times on the IRC-channel).
The updateMsg() and iMsg() takes a list of message-lines as argument
(or process a string to a list), and it'll output...
|
by: adamurbas |
last post by:
ya so im pretty much a newb to this whole python thing... its pretty
cool but i just started today and im already having trouble. i
started to use a tutorial that i found somewhere and i followed the
instructions and couldnt get the correct results. heres the code
stuff...
temperature=input("what is the temperature of the spam?")
if temperature>50:
print "the salad is properly cooked."
else:
|
by: CuTe_Engineer |
last post by:
hii,
i have cs assignment i tried to solve it but i still have many
errors , plzz help mee :"< it`s not cheating becuz i`ve tried & wrote
the prog. i just wanna you to show me my mistakes
#these are the operations
+ = ,
- = ,
* = ,
1/ = only if 0 not in .
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
| |
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |