A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

InputBox



 
 
Thread Tools Display Modes
  #1  
Old January 28th, 2008, 12:40 AM posted to microsoft.public.access.forms
Mike Revis[_2_]
external usenet poster
 
Posts: 20
Default InputBox

Hi Group,
Access 2000 win xppro

I have a command button on my form to print labels.
I would like to have an input box to enter the quantity of labels to print.

The code below is as far as I've gotten. It doesn't work. I should say the
inputBox part works.
I can't figure out how to get the quantity entered to give me that many
copies.


Private Sub cmdPrintLabel_Click()
On Error GoTo Err_cmdPrintLabel_Click

Dim stDocName As String

stDocName = "rpt4UpLabel"
InputBox "Enter quantity to print", "Label Quantity"
DoCmd.OpenReport stDocName, acViewPreview

Exit_cmdPrintLabel_Click:
Exit Sub

Err_cmdPrintLabel_Click:
MsgBox Err.Description
Resume Exit_cmdPrintLabel_Click

End Sub

As always any thoughts, comments or suggestions are welcome.

regards
Mike


  #2  
Old January 28th, 2008, 01:25 AM posted to microsoft.public.access.forms
Daniel Pineault
external usenet poster
 
Posts: 658
Default InputBox

Take a look at

http://groups.google.ca/group/micros...01f8d38e7ebda4

and

http://groups.google.ca/group/comp.d...a000bae71295a2

It should be what you're looking for.
--
Hope this helps,

Daniel Pineault
If this post was helpful, please rate it by using the vote buttons.



"Mike Revis" wrote:

Hi Group,
Access 2000 win xppro

I have a command button on my form to print labels.
I would like to have an input box to enter the quantity of labels to print.

The code below is as far as I've gotten. It doesn't work. I should say the
inputBox part works.
I can't figure out how to get the quantity entered to give me that many
copies.


Private Sub cmdPrintLabel_Click()
On Error GoTo Err_cmdPrintLabel_Click

Dim stDocName As String

stDocName = "rpt4UpLabel"
InputBox "Enter quantity to print", "Label Quantity"
DoCmd.OpenReport stDocName, acViewPreview

Exit_cmdPrintLabel_Click:
Exit Sub

Err_cmdPrintLabel_Click:
MsgBox Err.Description
Resume Exit_cmdPrintLabel_Click

End Sub

As always any thoughts, comments or suggestions are welcome.

regards
Mike



  #3  
Old January 28th, 2008, 02:17 AM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default InputBox

Private Sub cmdPrintLabel_Click()
On Error GoTo Err_cmdPrintLabel_Click

Dim stDocName As String

stDocName = "rpt4UpLabel"
Copies = Val(InputBox("Enter quantity to print", "Label Quantity"))
If Copies 0 Then
For i = 1 To Copies
DoCmd.OpenReport stDocName, acViewNormal
Next i
End If

Exit_cmdPrintLabel_Click:
Exit Sub

Err_cmdPrintLabel_Click:
MsgBox Err.Description
Resume Exit_cmdPrintLabel_Click

End Sub

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200801/1

  #4  
Old January 28th, 2008, 03:04 PM posted to microsoft.public.access.forms
Mike Revis[_2_]
external usenet poster
 
Posts: 20
Default InputBox

Thank you!

"Daniel Pineault" wrote in
message ...
Take a look at

http://groups.google.ca/group/micros...01f8d38e7ebda4

and

http://groups.google.ca/group/comp.d...a000bae71295a2

It should be what you're looking for.
--
Hope this helps,

Daniel Pineault
If this post was helpful, please rate it by using the vote buttons.



"Mike Revis" wrote:

Hi Group,
Access 2000 win xppro

I have a command button on my form to print labels.
I would like to have an input box to enter the quantity of labels to
print.

The code below is as far as I've gotten. It doesn't work. I should say
the
inputBox part works.
I can't figure out how to get the quantity entered to give me that many
copies.


Private Sub cmdPrintLabel_Click()
On Error GoTo Err_cmdPrintLabel_Click

Dim stDocName As String

stDocName = "rpt4UpLabel"
InputBox "Enter quantity to print", "Label Quantity"
DoCmd.OpenReport stDocName, acViewPreview

Exit_cmdPrintLabel_Click:
Exit Sub

Err_cmdPrintLabel_Click:
MsgBox Err.Description
Resume Exit_cmdPrintLabel_Click

End Sub

As always any thoughts, comments or suggestions are welcome.

regards
Mike





  #5  
Old January 28th, 2008, 03:05 PM posted to microsoft.public.access.forms
Mike Revis[_2_]
external usenet poster
 
Posts: 20
Default InputBox

Thank you!

"Linq Adams via AccessMonster.com" u28780@uwe wrote in message
news:7edce33d58485@uwe...
Private Sub cmdPrintLabel_Click()
On Error GoTo Err_cmdPrintLabel_Click

Dim stDocName As String

stDocName = "rpt4UpLabel"
Copies = Val(InputBox("Enter quantity to print", "Label Quantity"))
If Copies 0 Then
For i = 1 To Copies
DoCmd.OpenReport stDocName, acViewNormal
Next i
End If

Exit_cmdPrintLabel_Click:
Exit Sub

Err_cmdPrintLabel_Click:
MsgBox Err.Description
Resume Exit_cmdPrintLabel_Click

End Sub

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200801/1



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.