Label format???

BLONDIE2

New Member
Joined
Aug 12, 2004
Messages
17
I need to be able to print a page of labels (all EXACTLY THE SAME) --3 across & 10 down (Avery 5260 or Maco ML-3025).

I KNOW Access2000 can do this, because in the NORTHWIND example it does it (except each label is different).

I have set up the label, but can only get it to print a SINGLE label. HOW can I tell it to print all 30 labels.

PLEASE HELP---I've searched forum, looked throughout the NOrthwinds sample, but can't find the way to designate this--

Thanks in advance for your help!
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
A little more help, PLEASE!
Following are instructions for Label Saver. While I can do #1, how (where) do I perform steps 2-5 (I think I can do #6)?
Thanks,

To use Label Saver with your Access application:

1. Import the "basLabelSaver" module from the Label Saver .mdb file into your application.
2. Add the subroutine call "ls_ReportOnOpen Me, Cancel" to the report OnOpen event procedure.
3. Add the subroutine call "ls_DetailOnPrint Me" to the report detail OnPrint event procedure.
4. Create a label report header section if you don't already have one.
5. Add the subroutine call "ls_Init" to the report header OnFormat event procedure.
6. Set the report header section height to 0.

Your label report properties/procedures should look like this:

property: OnOpen

procedure: Private Sub Report_Open(Cancel As Integer)
ls_ReportOnOpen Me, Cancel 'Label Saver
End Sub


property: OnFormat (Report Header Section)

procedure: Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
ls_Init
End Sub


property: OnPrint (Detail Section)

procedure: Private Detail_Print(Cancel As Integer, PrintCount As Integer)
ls_DetailOnPrint Me 'Label Saver
End Sub

3. Save your report. That's it!
 
Upvote 0
LET ME REPHRASE! :confused:

Am I supposed to type : "Private Sub Report_Open(Cancel As Integer)
ls_ReportOnOpen Me, Cancel 'Label Saver
End Sub" Directly into the OnOpen box in the Event TAB for the report,

OR

Do I Chose Expression Builder, Macro Builder or Code Builder to do it???Which??

Thanks,
 
Upvote 0
Hi, this is how to go about it:
I assume that you have imported the module. If not, go to any existing module (or select New from the Modules tab in the database). File | Import, and browse to the .bas file that you want to include. Click Import, and you now have the code in your database.

OK -- now for the calls that they mentioned. I'll detail one, you should get the idea for the others.
Open the report in Design view. Select Properties, then click the Events tab.
Double-click the Open event line: you should now see [Event Procedure].
Click the Builder (...) button on that line, and you'll be in the code procedure for that event. In the blank line where the cursor currently is, type
ls_ReportOnOpen Me, Cancel 'Label Saver
Close the module to return to the form's Properties dialog.

Do the same for the other 2 events and you should be set.

Edit: For the Report Header event code, right-click the report header bar, select its Properties, and enter the code. Same for the Detail section.
Denis
 
Upvote 0
:biggrin:
THANK YOU SO MUCH!
I was trying to do it Without selecting the [Event Procedure] first, and I would get the the "chose builder" box, in which the line in Expression Builder would NOT be accepted...


I'm sorry if this is all so elementary, but I'm REAL NEW at this stuff...
THANK YOU SO MUCH for your help! IT WORKS GREAT!

NOW... It looks like I should be able to NOT choose starting position and number of labels, but have it ALWAYS start at #1 and print #30 (I don't need the variables)...I'm not sure where I should make these changes.

Any ideas?



Sub ls_ReportOnOpen(rpt As Report, ByRef Cancel As Integer)
'Prompts user for a label printing start position, and a number of copies.
'Sets variables for the OnFormat event procedure to handle

Dim iStartLabel As Integer
Dim iCopies As Integer
Dim vResp As Variant


On Error GoTo ls_ReportOnOpen_err

'Prompt user for starting label position
vResp = InputBox("Start at which label?", "Label Saver", 1)
If vResp = "" Then
'Cancel was clicked
Cancel = True
GoTo ls_ReportOnOpen_exit
End If
iStartLabel = CInt(vResp)

'Validation check
If iStartLabel >= 1 And iStartLabel <= 400 Then
Else
MsgBox "Starting label must be between 1 and 400." & vbCrLf & vbCrLf & " Labels/Report cancelled"
Cancel = True
GoTo ls_ReportOnOpen_exit
End If

'Prompt user for number of copies
vResp = InputBox("How many copies of each label?", "Label Saver", 1)
If vResp = "" Then
'Cancel was clicked
Cancel = True
GoTo ls_ReportOnOpen_exit
End If
iCopies = CInt(vResp)

'Validation check
If iCopies < 1 Then
MsgBox "Number of copies must be greater than 0." & vbCrLf & vbCrLf & " Labels/Report cancelled"
Cancel = True
GoTo ls_ReportOnOpen_exit
Else
If iCopies >= 1 And iCopies <= 100 Then
Else
If MsgBox("Are you sure you want to print " & iCopies & " copies of each label?", vbYesNo, "Label Saver") = vbYes Then
Else
MsgBox "Labels/Report cancelled"
Cancel = True
GoTo ls_ReportOnOpen_exit
End If
End If
End If

'Set variables. These are used in the Report Detail OnFormat event procedure
iLSBlankRecordsToPrint = iStartLabel - 1
iLSCopiesToPrint = iCopies

ls_ReportOnOpen_exit:
Exit Sub
ls_ReportOnOpen_err:
MsgBox "Error in Label Saver subroutine ls_ReportOnOpen - " & Err & " - " & Err.Description
GoTo ls_ReportOnOpen_exit
End Sub


Sub ls_ReportOnPage()
'iLSBlankCount = 0
End Sub
 
Upvote 0
I found if I removed this...

'Prompt user for number of copies
vResp = InputBox("How many copies of each label?", "Label Saver", 1)
If vResp = "" Then
'Cancel was clicked
Cancel = True
GoTo ls_ReportOnOpen_exit
End If

And changed "iCopies = CInt(vResp)" to "iCopies = CInt(30)" (and did the like changes to iStartLabel, it works. I left the validation stuff in...Should I delete it as extraneous material, or is there any reason to leave it in.

Anyway...Thank you, Denis, for your help!
 
Upvote 0

Forum statistics

Threads
1,221,810
Messages
6,162,108
Members
451,743
Latest member
matt3388

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