I'm writing a SUB PROCEDURE that has many IF THEN ELSE staements. As a matter of fact, there are too many and I am getting errors. Is there a simple solution?
Here is a quick run down on what I am attempting:
When I open the form, it hides certain fields and displays others ...
The section below is where I am experiencing my problem.
First I decide what fields need to be visible and what they should be labeled.
These are the most common labels but depending on the vendor number, they can change once again.
Then, depending on the Vendor Number, a different calculation must be formed. This could mean a different discount, a different markup, different currency, additional charges ... and so on.
By now it should be obvious that this is definately going to go over the 64K limit that is allowed.
Can you give me some direction? Any help would be appreciated. If you cannot, please let me know and I will seek help elsewhere ...
Private Sub NON_Stock_Corp_Click()
PriceTypeLabel = "Name of Corporate Vendor"
Me!NON_Stock_Corp.Caption = "CALCULATE"
Me!CurrencyExchange.Caption = "Currency Exchange"
Me!StockItemCorp.Visible = False
Me!StockItemJOBBER.Visible = False
Me!NON_Stock_JOBBER.Visible = False
Me!NON_Stock_OEM.Visible = False
Me!NothingElse.Visible = False
Me!Split.Visible = False
Me!VendorCodes.Visible = True
Me!Cost1Label.Visible = True
Me!Cost1.Visible = True
Me!PriceType.Visible = True
Me!Vendor.Visible = True
Cost1Label = "Jobber"
Core1Label = "Core Charge"
If Vendor = "7234" Then
Cost2Label = "Current Exchange Rate"
PriceType = "Company A"
Cost1Label = "Cost in Canadian $"
Notes = "Airlift will give you our cost in Canadian Funds" + vbCrLf + "Verify if from Canadian warehouse or US"
Cost = Cost1
Consumer = Cost1 * 1.9
Dealer = (Consumer - Cost) * 0.57 + Cost
Core = Core1: End
End If
If Vendor = "8583A" Then
Me!Core1Label.Visible = True
Me!Core1.Visible = True
PriceType = "Company B"
Cost1Label = "EAP Cost"
Notes = "Use this number for Cooling Parts only. For all else. please use 8583B"
Consumer = (Cost1 * 2) + Core1
Dealer = (((Consumer - Core1) - Cost1) * 0.57) + (Core1 + Cost1)
Cost = Cost1 + Core1
Core = Core1: End
End If
.... and the list goes on.
Thank you in advance.
Here is a quick run down on what I am attempting:
When I open the form, it hides certain fields and displays others ...
The section below is where I am experiencing my problem.
First I decide what fields need to be visible and what they should be labeled.
These are the most common labels but depending on the vendor number, they can change once again.
Then, depending on the Vendor Number, a different calculation must be formed. This could mean a different discount, a different markup, different currency, additional charges ... and so on.
By now it should be obvious that this is definately going to go over the 64K limit that is allowed.
Can you give me some direction? Any help would be appreciated. If you cannot, please let me know and I will seek help elsewhere ...
Private Sub NON_Stock_Corp_Click()
PriceTypeLabel = "Name of Corporate Vendor"
Me!NON_Stock_Corp.Caption = "CALCULATE"
Me!CurrencyExchange.Caption = "Currency Exchange"
Me!StockItemCorp.Visible = False
Me!StockItemJOBBER.Visible = False
Me!NON_Stock_JOBBER.Visible = False
Me!NON_Stock_OEM.Visible = False
Me!NothingElse.Visible = False
Me!Split.Visible = False
Me!VendorCodes.Visible = True
Me!Cost1Label.Visible = True
Me!Cost1.Visible = True
Me!PriceType.Visible = True
Me!Vendor.Visible = True
Cost1Label = "Jobber"
Core1Label = "Core Charge"
If Vendor = "7234" Then
Cost2Label = "Current Exchange Rate"
PriceType = "Company A"
Cost1Label = "Cost in Canadian $"
Notes = "Airlift will give you our cost in Canadian Funds" + vbCrLf + "Verify if from Canadian warehouse or US"
Cost = Cost1
Consumer = Cost1 * 1.9
Dealer = (Consumer - Cost) * 0.57 + Cost
Core = Core1: End
End If
If Vendor = "8583A" Then
Me!Core1Label.Visible = True
Me!Core1.Visible = True
PriceType = "Company B"
Cost1Label = "EAP Cost"
Notes = "Use this number for Cooling Parts only. For all else. please use 8583B"
Consumer = (Cost1 * 2) + Core1
Dealer = (((Consumer - Core1) - Cost1) * 0.57) + (Core1 + Cost1)
Cost = Cost1 + Core1
Core = Core1: End
End If
.... and the list goes on.
Thank you in advance.