Printing Labels

SRN

Registered User.
Local time
Today, 14:33
Joined
Nov 8, 2002
Messages
21
Hi,

Please can someone help!!

What i have is a table with 5 fields defined.
Style (text)
Colour (Text)
Description (text)
Size (text)
Qty (number)

At the moment its a single record. but in the qty field there is 300. what i need to do is write a piece of code that will write the information out 300 times so i can then print 300 labels to go on to each individual packet.

Thanks
 
use an update query to set the blanks to 300
 
Thanks for the reply,

but what do you mean by setting the blanks to 300
 
Ah, misread you - you only have 1 record.
 
Copy this to a module: A97 method

Code:
Function DAOMethod()

    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    Dim intCounter As Integer
    Dim strStyle As String
    Dim strColour As String
    Dim strDescription As String
    Dim strSize As String
    Dim lngQty As Long

    Set db = CurrentDb
    Set rs = db.OpenRecordset("<<Insert your Table Name Here>>")
    
    With rs
        .MoveFirst
        strStyle = rs.Fields("Style")
        strColour = rs.Fields("Colour")
        strDescription = rs.Fields("Description")
        strSize = rs.Fields("Size")
        lngQty = rs.Fields("Qty")
        For intCounter = 1 To 299
            .AddNew
            .Fields("Style") = strStyle
            .Fields("Colour") = strColour
            .Fields("Description") = strDescription
            .Fields("Size") = strSize
            .Fields("Qty") = lngQty
            .Update
        Next intCounter
        .Close
    End With
    
    Set rs = Nothing
    Set db = Nothing

    MsgBox "Done.", vbInformation
    
End Function


Change the Table Name part.


Position the cursor inside the function and hit F5
 
Works a treat

thanks for your time Mike
 

Users who are viewing this thread

Back
Top Bottom