![]() |
Class Module Problem
I've got a Class Module that Prints certain sheets when selected by a
checkbox on my form however it has a syntax error when it tries to go to the class module my code is as per follows: Code from Form Public C As MyProject.Class1 Private Sub CommandButton1_Click() PCopies = ComboBox2.Value C.Prints1(Copies:=PCopies, PQuote:=Checkbox8.Value, PContract:=Checkbox5.Value, PCSelection:=Checkbox36.Value _ , PFloorPlan:=Checkbox10.Value, PElevation:=Checkbox14.Value, PSlabPlan:=Checkbox13.Value, PFLayouts:=Checkbox17.Value _ , PFDetails:=Checkbox35.Value, PFSchedule:=Checkbox16.Value, PPPunching:=Checkbox7.Value, PMaterialList:=Checkbox31.Value _ , POrders:=Checkbox1.Value, PItemPricing:=Checkbox9.Value, PSupplierPrice:=Checkbox12.Value, PJobCost:=Checkbox18.Value _ , PWorkshopList:=Checkbox33.Value) End Sub Code From Class Module Sub Prints1(Copies As Integer, PQuote As Boolean, PContract As Boolean, PCSelection As Boolean _ , PFloorPlan As Boolean, PElevation As Boolean, PSlabPlan As Boolean, PFLayouts As Boolean, PFDetails As Boolean _ , PFSchedule As Boolean, PPPunching As Boolean, PMaterialList As Boolean, POrders As Boolean, PItemPricing As Boolean _ , PSupplierPrice As Boolean, PJobCost As Boolean, PWorkshopList As Boolean) x = 1 Do Until x = Copies + 1 If PQuote = True Then End If If PContract = True Then End If If PCSelection = True Then End If If PFloorPlan = True Then End If If PElevation = True Then End If If PSlabPlan = True Then End If If PFLayouts = True Then End If If PFDetails = True Then End If If PFSchedule = True Then End If If PPPunching = True Then End If If PMaterialList = True Then End If If POrders = True Then End If If PItemPricing = True Then End If If PSupplierPrice = True Then End If If PJobCost = True Then End If If PWorkshopList = True Then End If x = x + 1 Loop End Sub Any Help would be greatly Appreiciated Jason |
Class Module Problem
You don't need the brackets
C.Prints1 Copies:=PCopies, _ PQuote:=Checkbox8.Value, _ PContract:=Checkbox5.Value, _ PCSelection:=Checkbox36.Value, _ PFloorPlan:=Checkbox10.Value, _ PElevation:=Checkbox14.Value, _ PSlabPlan:=Checkbox13.Value, _ PFLayouts:=Checkbox17.Value, _ PFDetails:=Checkbox35.Value, _ PFSchedule:=Checkbox16.Value, _ PPPunching:=Checkbox7.Value, _ PMaterialList:=Checkbox31.Value, _ POrders:=Checkbox1.Value, _ PItemPricing:=Checkbox9.Value, _ PSupplierPrice:=Checkbox12.Value, _ PJobCost:=Checkbox18.Value, _ PWorkshopList:=Checkbox33.Value -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Jason Zischke" wrote in message ... I've got a Class Module that Prints certain sheets when selected by a checkbox on my form however it has a syntax error when it tries to go to the class module my code is as per follows: Code from Form Public C As MyProject.Class1 Private Sub CommandButton1_Click() PCopies = ComboBox2.Value C.Prints1(Copies:=PCopies, PQuote:=Checkbox8.Value, PContract:=Checkbox5.Value, PCSelection:=Checkbox36.Value _ , PFloorPlan:=Checkbox10.Value, PElevation:=Checkbox14.Value, PSlabPlan:=Checkbox13.Value, PFLayouts:=Checkbox17.Value _ , PFDetails:=Checkbox35.Value, PFSchedule:=Checkbox16.Value, PPPunching:=Checkbox7.Value, PMaterialList:=Checkbox31.Value _ , POrders:=Checkbox1.Value, PItemPricing:=Checkbox9.Value, PSupplierPrice:=Checkbox12.Value, PJobCost:=Checkbox18.Value _ , PWorkshopList:=Checkbox33.Value) End Sub Code From Class Module Sub Prints1(Copies As Integer, PQuote As Boolean, PContract As Boolean, PCSelection As Boolean _ , PFloorPlan As Boolean, PElevation As Boolean, PSlabPlan As Boolean, PFLayouts As Boolean, PFDetails As Boolean _ , PFSchedule As Boolean, PPPunching As Boolean, PMaterialList As Boolean, POrders As Boolean, PItemPricing As Boolean _ , PSupplierPrice As Boolean, PJobCost As Boolean, PWorkshopList As Boolean) x = 1 Do Until x = Copies + 1 If PQuote = True Then End If If PContract = True Then End If If PCSelection = True Then End If If PFloorPlan = True Then End If If PElevation = True Then End If If PSlabPlan = True Then End If If PFLayouts = True Then End If If PFDetails = True Then End If If PFSchedule = True Then End If If PPPunching = True Then End If If PMaterialList = True Then End If If POrders = True Then End If If PItemPricing = True Then End If If PSupplierPrice = True Then End If If PJobCost = True Then End If If PWorkshopList = True Then End If x = x + 1 Loop End Sub Any Help would be greatly Appreiciated Jason |
Class Module Problem
Thanks bob that got it working.
Jason "Bob Phillips" wrote: You don't need the brackets C.Prints1 Copies:=PCopies, _ PQuote:=Checkbox8.Value, _ PContract:=Checkbox5.Value, _ PCSelection:=Checkbox36.Value, _ PFloorPlan:=Checkbox10.Value, _ PElevation:=Checkbox14.Value, _ PSlabPlan:=Checkbox13.Value, _ PFLayouts:=Checkbox17.Value, _ PFDetails:=Checkbox35.Value, _ PFSchedule:=Checkbox16.Value, _ PPPunching:=Checkbox7.Value, _ PMaterialList:=Checkbox31.Value, _ POrders:=Checkbox1.Value, _ PItemPricing:=Checkbox9.Value, _ PSupplierPrice:=Checkbox12.Value, _ PJobCost:=Checkbox18.Value, _ PWorkshopList:=Checkbox33.Value -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Jason Zischke" wrote in message ... I've got a Class Module that Prints certain sheets when selected by a checkbox on my form however it has a syntax error when it tries to go to the class module my code is as per follows: Code from Form Public C As MyProject.Class1 Private Sub CommandButton1_Click() PCopies = ComboBox2.Value C.Prints1(Copies:=PCopies, PQuote:=Checkbox8.Value, PContract:=Checkbox5.Value, PCSelection:=Checkbox36.Value _ , PFloorPlan:=Checkbox10.Value, PElevation:=Checkbox14.Value, PSlabPlan:=Checkbox13.Value, PFLayouts:=Checkbox17.Value _ , PFDetails:=Checkbox35.Value, PFSchedule:=Checkbox16.Value, PPPunching:=Checkbox7.Value, PMaterialList:=Checkbox31.Value _ , POrders:=Checkbox1.Value, PItemPricing:=Checkbox9.Value, PSupplierPrice:=Checkbox12.Value, PJobCost:=Checkbox18.Value _ , PWorkshopList:=Checkbox33.Value) End Sub Code From Class Module Sub Prints1(Copies As Integer, PQuote As Boolean, PContract As Boolean, PCSelection As Boolean _ , PFloorPlan As Boolean, PElevation As Boolean, PSlabPlan As Boolean, PFLayouts As Boolean, PFDetails As Boolean _ , PFSchedule As Boolean, PPPunching As Boolean, PMaterialList As Boolean, POrders As Boolean, PItemPricing As Boolean _ , PSupplierPrice As Boolean, PJobCost As Boolean, PWorkshopList As Boolean) x = 1 Do Until x = Copies + 1 If PQuote = True Then End If If PContract = True Then End If If PCSelection = True Then End If If PFloorPlan = True Then End If If PElevation = True Then End If If PSlabPlan = True Then End If If PFLayouts = True Then End If If PFDetails = True Then End If If PFSchedule = True Then End If If PPPunching = True Then End If If PMaterialList = True Then End If If POrders = True Then End If If PItemPricing = True Then End If If PSupplierPrice = True Then End If If PJobCost = True Then End If If PWorkshopList = True Then End If x = x + 1 Loop End Sub Any Help would be greatly Appreiciated Jason |
All times are GMT +1. The time now is 05:44 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com