acgogl.blogg.se

Custom label wizard access
Custom label wizard access













custom label wizard access

Custom label wizard access code#

Now, if I don't open the report on access, I get the following error on debug, for the first line of code I pointed out above (roughly translated):

custom label wizard access custom label wizard access

My problem is on the following lines of code: Test.RecordSource = "SELECT * FROM SSCC_Gen WHERE Pre_SSCC BETWEEN " & CStr(oldLastLabelRecordIndex) & " AND " & CStr(lastLabelRecordIndex) LastLabelRecordIndex = lastLabelRecordIndex_Part1 & lastLabelRecordIndex_Part2 OldLastLabelRecordIndex = oldLastLabelRecordIndex_Part1 & oldLastLabelRecordIndex_Part2 LastLabelRecordIndex_Part2 = CStr(Right(rs("MaxRecord"), 9)) LastLabelRecordIndex_Part1 = CStr(Left(rs("MaxRecord"), 8)) OldLastLabelRecordIndex_Part2 = CStr(Right(rs("MaxRecord"), 9))įor labelRecordIndex = CLng(oldLastLabelRecordIndex_Part2) To CLng(oldLastLabelRecordIndex_Part2) + Me.txtNumberOfLabels.Value - 1ĭoCmd.RunSQL "INSERT INTO SSCC_GenCount (Data) VALUES (#" & Format(Now(), "dd/mm/yyyy") & "#)" OldLastLabelRecordIndex_Part1 = CStr(Left(rs("MaxRecord"), 8)) Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot) StrSQL = "SELECT MAX(Pre_SSCC) As MaxRecord FROM SSCC_Gen" Set Application.Printer = availablePrintersĭim oldLastLabelRecordIndex_Part1 As Stringĭim oldLastLabelRecordIndex_Part2 As String If availablePrinters.DeviceName = selectedPrinter Then MsgBox "Please indicate the number of labels you want to print", _įor Each availablePrinters In Application.Printers If IsNull(Me.txtNumberOfLabels) Or Not IsNumeric(Me.txtNumberOfLabels.Value) Then 'If set to 0, label report is blank but runs. Me.cbPrintersList.AddItem (Application.Printers(printerIndex).DeviceName)Īnd here's the code for the btnPrint_Click event Private Sub btnPrint_Click() Now, the purpose of the Imp_Etiq_SCC Form is to give the user the ability to print a certain number of labels (that will be generated before printing them), after the user selects the printer where the labels will be print and types in the number of labels to print.įor printerIndex = 0 To - 1 In other words people will just have to open an access database and use a form to print from a design gerenated report.Īs it stands, I have a query view named SSCC_Gen, which displays a temporary table that will store the labels for printing, a form named Imp_Etiq_SCC and a report named Labels_SSCC_Gen Sample of SSCC_Gen query view I'm in need of giving autonomy to people regarding the printing of labels without the need of having to use Excel cells as an input.















Custom label wizard access