Print Copies based on Quantity from Table.

agb136

New Member
Joined
Jan 26, 2006
Messages
34
I am very new to Access, but I feel like this should be pretty easy. I am trying to create a form where I type in the item number (Currently using a combination box) and then another box auto populates my print quantity from the table that is based on the item number. Then I want to hit my Command button to print my report with the number of copies in the Print Quantity field.

I get a really quick flash of a popup box on my screen and then nothing happens. I am trying to use this code with my report:

Option Compare Database

Option Explicit
Dim intPrintCounter As Integer
Dim intNumberRepeats As Integer


Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If intPrintCounter < intNumberRepeats Then
intPrintCounter = intPrintCounter + 1
Me.NextRecord = False
Else
intPrintCounter = 1
Me.NextRecord = True
End If
End Sub

Private Sub Report_Open(Cancel As Integer)
intPrintCounter = 1
intNumberRepeats = Forms!Form1!#ofCards
End Sub

Thanks for the help!
agb
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
What happens when you replace the line
Code:
intNumberRepeats = Forms!Form1!#ofCards

with

Code:
intNumberRepeats = 5

I think the issue might be with that line and you trying to get the number of copies to print from the form. If that is the issue, then we will be one step closer to getting the answer.
 
Upvote 0

Forum statistics

Threads
1,221,707
Messages
6,161,411
Members
451,704
Latest member
rvan07

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top