Private Sub AddBelt_cmd_Click()
OpenAddBelt
End Sub
Private Sub Annuleren_cmd_Click()
Unload Me
End Sub
Private Sub Berekenen_cmd_Click()
Dim EverythingFilledIn As Boolean
EverythingFilledIn = True
If Snelheid_txt.Value = "" Then
Snelheid_txt.BackColor = rgbPink
Snelheid_lbl.ForeColor = rgbRed
EverythingFilledIn = False
End If
If Wrijving_cbo.Value = "" Then
Wrijving_cbo.BackColor = rgbPink
Wrijving_lbl.ForeColor = rgbRed
EverythingFilledIn = False
End If
If Lengte_txt.Value = "" Then
Lengte_txt.BackColor = rgbPink
Lengte_lbl.ForeColor = rgbRed
EverythingFilledIn = False
End If
If Helling_cbo.Value = "" Then
Helling_cbo.BackColor = rgbPink
Helling_lbl.ForeColor = rgbRed
EverythingFilledIn = False
End If
If Radius_txt.Value = "" Then
Radius_txt.BackColor = rgbPink
Radius_lbl.ForeColor = rgbRed
EverythingFilledIn = False
End If
If Band_txt.Value = "" Then
Band_txt.BackColor = rgbPink
Band_lbl.ForeColor = rgbRed
EverythingFilledIn = False
End If
If Product_txt.Value = "" Then
Product_txt.BackColor = rgbPink
Product_lbl.ForeColor = rgbRed
EverythingFilledIn = False
End If
If Aantal_txt.Value = "" Then
Aantal_txt.BackColor = rgbPink
Aantal_lbl.ForeColor = rgbRed
EverythingFilledIn = False
End If
If Producent_cbo.Value = "" Then
Producent_cbo.BackColor = rgbPink
Producent_lbl.ForeColor = rgbRed
EverythingFilledIn = False
End If
If Type_cbo.Value = "" Then
Type_cbo.BackColor = rgbPink
Type_lbl.ForeColor = rgbRed
EverythingFilledIn = False
End If
If CheckBox = True Then
If VF_txt.Value = "" Then
VF_txt.BackColor = rgbPink
CheckBox.ForeColor = rgbRed
EverythingFilledIn = False
End If
End If
If Not EverythingFilledIn Then Exit Sub
Call AddInvoer
Call AddGegevens
Menu.Select
End Sub
Private Sub AddInvoer()
Berekeningen.Select
Range("C2").Select
ActiveCell.Value = Snelheid_txt.Value
Range("C3").Select
ActiveCell.Value = Lengte_txt.Value
Range("C4").Select
ActiveCell.Value = Wrijving_cbo.Value
Range("C6").Select
ActiveCell.Value = Radius_txt.Value
Range("C12").Select
ActiveCell.Value = Band_txt.Value
Range("C8").Select
ActiveCell.Value = Product_txt.Value
Range("C9").Select
ActiveCell.Value = Aantal_txt.Value
Select Case Helling_cbo.Value
Case "Horizontaal"
Range("H4").Select
ActiveCell.Value = Hoek_txt.Value
Case "Negatief"
Range("H3").Select
ActiveCell.Value = Hoek_txt.Value
Case "Positief"
Range("H2").Select
ActiveCell.Value = Hoek_txt.Value
Case Else
Call Error_Helling
Call Error_Hoek
End Select
Range("C5").Select
Select Case Helling_cbo.Value
Case "Horizontaal"
ActiveCell.Value = Range("H4").Value
Case "Negatief"
ActiveCell.Value = Range("H3").Value
Case "Positief"
ActiveCell.Value = Range("H2").Value
End Select
Range("C11").Select
If CheckBox = True Then
ActiveCell.Value = VF_txt.Value
Else
ActiveCell.Value = 1
End If
End Sub
Private Sub AddGegevens()
Berekeningen.Select
Vermogen_txt.Value = Range("C25").Value
Toerental_txt.Value = Range("C26").Value
Koppel_txt.Value = Range("C27").Value
End Sub
Private Sub CheckBox_AfterUpdate()
CheckBox.ForeColor = rgbBlack
End Sub
Private Sub CheckBox_Click()
If CheckBox.Value = False Then
VF_txt.BackColor = &H80000004
VF_txt.Enabled = False
VF_txt.BorderColor = &H80000004
End If
If CheckBox.Value = True Then
VF_txt.BackColor = rgbWhite
VF_txt.Enabled = True
VF_txt.BorderColor = Me.BorderColor
End If
End Sub
Private Sub Handmatig_check_Click()
If Handmatig_check.Value = False Then
Handmatig_txt.BackColor = &H80000004
Handmatig_txt.Enabled = False
Handmatig_txt.BorderColor = &H80000004
Producent_lbl.ForeColor = Me.ForeColor
Producent_cbo.BackColor = rgbWhite
Producent_cbo.Enabled = True
Producent_cbo.BorderColor = &H80000006
Producent_cbo.Text = ""
Type_lbl.ForeColor = Me.ForeColor
Type_cbo.BackColor = rgbWhite
Type_cbo.Enabled = True
Type_cbo.BorderColor = &H80000006
Type_cbo.Text = ""
End If
If Handmatig_check.Value = True Then
Handmatig_txt.BackColor = rgbWhite
Handmatig_txt.Enabled = True
Handmatig_txt.BorderColor = Me.BorderColor
Producent_lbl.ForeColor = &H80000004
Producent_cbo.BackColor = &H80000004
Producent_cbo.Enabled = False
Producent_cbo.BorderColor = &H80000004
Producent_cbo.Text = "Handmatig Ingevoerd"
Type_lbl.ForeColor = &H80000004
Type_cbo.BackColor = &H80000004
Type_cbo.Enabled = False
Type_cbo.BorderColor = &H80000004
Type_cbo.Text = "Handmatig Ingevoerd"
End If
End Sub
Private Sub Helling_cbo_AfterUpdate()
If Helling_cbo.Value = "" Then
Hoek_lbl.ForeColor = Me.ForeColor
Hoek_txt.BackColor = rgbWhite
Hoek_txt.Enabled = True
Hoek_txt.BorderColor = &H80000006
End If
If Helling_cbo.Value = "Horizontaal" Then
Hoek_lbl.ForeColor = &H80000004
Hoek_txt.BackColor = &H80000004
Hoek_txt.Enabled = False
Hoek_txt.BorderColor = &H80000004
End If
End Sub
Private Sub Helling_cbo_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If IsNumeric(Helling_cbo.Value) Or Helling_cbo.Value < 0 Then
Call Error_Helling
Cancel = True
End If
End Sub
Private Sub Helling_cbo_Change()
If Helling_cbo.Value <> "Horizontaal" Then
Hoek_lbl.ForeColor = Me.ForeColor
Hoek_txt.BackColor = rgbWhite
Hoek_txt.Enabled = True
Hoek_txt.BorderColor = &H80000006
End If
If Helling_cbo.Value <> "" Then
Helling_cbo.BackColor = rgbWhite
Helling_lbl.ForeColor = Me.ForeColor
End If
' Select Case Helling_cbo
' Case "Positief"
' Situatieschets_img.Picture = LoadPicture(Range("H2"))
' Situatieschets_img.PictureSizeMode = fmPictureSizeModeZoom
' Case "Negatief"
' Situatieschets_img.Picture = LoadPicture(Range("H3"))
' Situatieschets_img.PictureSizeMode = fmPictureSizeModeZoom
' Case "Horizontaal"
' Situatieschets_img.Picture = LoadPicture(Range("H4"))
' Situatieschets_img.PictureSizeMode = fmPictureSizeModeZoom
' Case Else
' Situatieschets_img.Picture = LoadPicture(Range("H5"))
' Situatieschets_img.PictureSizeMode = fmPictureSizeModeZoom
' End Select
End Sub
Private Sub Hoek_txt_AfterUpdate()
If Hoek_txt.Value <> "" Then
Hoek_txt.BackColor = rgbWhite
Hoek_lbl.ForeColor = Me.ForeColor
End If
End Sub
Private Sub Hoek_txt_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If Not IsNumeric(Hoek_txt.Value) Or Hoek_txt.Value < 0 Then
Call Error_Hoek
Cancel = True
End If
End Sub
Private Sub Producent_cbo_Change()
Select Case Producent_cbo
Case "Ammeraal Beltech"
Type_cbo.List = Berekeningen.Range("H11", Berekeningen.Range("H11").End(xlDown)).Value
Case "Habasit"
Type_cbo.List = Berekeningen.Range("L11", Berekeningen.Range("L11").End(xlDown)).Value
Case "Intralox"
Type_cbo.List = Berekeningen.Range("P11", Berekeningen.Range("P11").End(xlDown)).Value
End Select
' Type_cbo.List = Berekeningen.Range(FindValue(Producent_cbo), Berekeningen.Range(FindValue(Producent_cbo)).End(xlUp)).Value
End Sub
Private Sub Producent_cbo_AfterUpdate()
If Producent_cbo.Value <> "" Then
Producent_cbo.BackColor = rgbWhite
Producent_lbl.ForeColor = Me.ForeColor
End If
End Sub
Private Sub Snelheid_qm_Click()
MsgBox "In deze tekstbox kan de snelheid die de conveyor moet hebben ingevuld worden. Waardes voor de snelheid dienen ingevuld te worden in meter per seconde.", vbOKOnly + vbQuestion
End Sub
Private Sub Type_cbo_AfterUpdate()
FindValueType(Type_cbo.Value).Select
' Range ActiveCell.Offset(0,1).Value =
Range("C7").Value = ActiveCell.Offset(0, 2).Value
If Producent_cbo.Value <> "" Then
Producent_cbo.BackColor = rgbWhite
Producent_lbl.ForeColor = Me.ForeColor
End If
End Sub
Private Sub Lengte_qm_Click()
MsgBox "In deze tekstbox kan de lengte van de conveyor ingevuld worden. Hiermee wordt de gehele lengte van de band bedoeld. Waardes voor de lengte dienen ingevuld te worden in meters. ", vbOKOnly + vbQuestion
End Sub
Private Sub Helling_qm_Click()
MsgBox "In dit keuzemenu kan gekozen worden in welke hoek de conveyor gepositioneerd is. Hiervan wordt de situatie weergegeven in het nevenstaande scherm.", vbOKOnly + vbQuestion
End Sub
Private Sub Hoek_qm_Click()
MsgBox "In deze tekstbox kan de hoek waaronder de conveyor staat ingegeven worden. Dit venster wordt alleen beschikbaar gesteld wanneer de bandpositionering een hoek betreft. Waardes voor de hoek waarin de conveyor gepositioneerd staat dienen ingevuld te worden in graden.", vbOKOnly + vbQuestion
End Sub
Private Sub Snelheid_txt_AfterUpdate()
If Snelheid_txt.Value <> "" Then
Snelheid_txt.BackColor = rgbWhite
Snelheid_lbl.ForeColor = Me.ForeColor
End If
End Sub
Private Sub Snelheid_txt_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If Not IsNumeric(Snelheid_txt.Value) Or Snelheid_txt.Value < 0 Then
Call Error_Snelheid
Cancel = True
End If
End Sub
Private Sub lengte_txt_AfterUpdate()
If Lengte_txt.Value <> "" Then
Lengte_txt.BackColor = rgbWhite
Lengte_lbl.ForeColor = Me.ForeColor
End If
End Sub
Private Sub lengte_txt_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If Not IsNumeric(Lengte_txt.Value) Or Lengte_txt.Value < 0 Then
Call Error_lengte
Cancel = True
End If
End Sub
Private Sub UserForm_Initialize()
Hoek_lbl.ForeColor = &H80000004
Hoek_txt.BackColor = &H80000004
Hoek_txt.Enabled = False
Hoek_txt.BorderColor = &H80000004
Producent_cbo.List = Berekeningen.Range("F11", Berekeningen.Range("F11").End(xlDown)).Value
VF_txt.BackColor = &H80000004
VF_txt.Enabled = False
VF_txt.BorderColor = &H80000004
Handmatig_txt.BackColor = &H80000004
Handmatig_txt.Enabled = False
Handmatig_txt.BorderColor = &H80000004
End Sub
Private Sub UserForm_Terminate()
Menu.Select
End Sub
Private Sub WisInvoer_cmd_Click()
Helling_cbo.Value = ""
Hoek_lbl.ForeColor = &H80000004
Hoek_txt.BackColor = &H80000004
Hoek_txt.Enabled = False
Hoek_txt.BorderColor = &H80000004
Dim ctl As MSForms.Control
For Each ctl In Me.Controls
If TypeOf ctl Is MSForms.TextBox Then
If ctl.Value <> "" Then
ctl.Value = ""
End If
End If
Next ctl
End Sub
Private Sub Wrijving_cbo_AfterUpdate()
If Wrijving_cbo.Value <> "" Then
Wrijving_cbo.BackColor = rgbWhite
Wrijving_lbl.ForeColor = Me.ForeColor
End If
End Sub
Private Sub Error_Snelheid()
Snelheid_txt.BackColor = rgbPink
Snelheid_lbl.ForeColor = rgbRed
Snelheid_txt.SetFocus
EverythingFilledIn = False
Snelheid_txt.SelStart = 0
Snelheid_txt.SelLength = Len(Snelheid_txt.Value)
End Sub
Private Sub Error_Wrijving()
Wrijving_cbo.BackColor = rgbPink
Wrijving_lbl.ForeColor = rgbRed
Wrijving_cbo.SetFocus
EverythingFilledIn = False
Wrijving_cbo.SelStart = 0
Wrijving_cbo.SelLength = Len(Wrijving_cbo.Value)
End Sub
Private Sub Error_lengte()
Lengte_txt.BackColor = rgbPink
Lengte_lbl.ForeColor = rgbRed
Lengte_txt.SetFocus
EverythingFilledIn = False
Lengte_txt.SelStart = 0
Lengte_txt.SelLength = Len(Lengte_txt.Value)
End Sub
Private Sub Error_Aantal()
Aantal_txt.BackColor = rgbPink
Aantal_lbl.ForeColor = rgbRed
Aantal_txt.SetFocus
EverythingFilledIn = False
Aantal_txt.SelStart = 0
Aantal_txt.SelLength = Len(Aantal_txt.Value)
End Sub
Private Sub Error_Product()
Product_txt.BackColor = rgbPink
Product_lbl.ForeColor = rgbRed
Product_txt.SetFocus
EverythingFilledIn = False
Product_txt.SelStart = 0
Product_txt.SelLength = Len(Product_txt.Value)
End Sub
Private Sub Error_Radius()
Radius_txt.BackColor = rgbPink
Radius_lbl.ForeColor = rgbRed
Radius_txt.SetFocus
EverythingFilledIn = False
Radius_txt.SelStart = 0
Radius_txt.SelLength = Len(Radius_txt.Value)
End Sub
Private Sub Error_Band()
Band_txt.BackColor = rgbPink
Band_lbl.ForeColor = rgbRed
Band_txt.SetFocus
EverythingFilledIn = False
Band_txt.SelStart = 0
Band_txt.SelLength = Len(Band_txt.Value)
End Sub
Private Sub Error_Helling()
Helling_cbo.BackColor = rgbPink
Helling_lbl.ForeColor = rgbRed
Helling_cbo.SetFocus
EverythingFilledIn = False
Helling_cbo.SelStart = 0
Helling_cbo.SelLength = Len(Helling_cbo.Value)
Hoek_lbl.ForeColor = &H80000004
Hoek_txt.BackColor = &H80000004
Hoek_txt.Enabled = False
Hoek_txt.BorderColor = &H80000004
End Sub
Private Sub Wrijving_cbo_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If Not IsNumeric(Wrijving_cbo.Value) Or Wrijving_cbo.Value < 0 Then
Call Error_Wrijving
Cancel = True
End If
End Sub
Private Sub Error_Hoek()
Hoek_txt.BackColor = rgbPink
Hoek_lbl.ForeColor = rgbRed
' Hoek_txt.SetFocus
EverythingFilledIn = False
Hoek_txt.SelStart = 0
Hoek_txt.SelLength = Len(Hoek_txt.Value)
End Sub
Function FindValue(Value As String) As Range
'Variablen Aangeven
Dim SearchRange As Range
Set SearchRange = Range("F10", Range("F10").End(xlToRight))
Set FindValue = SearchRange.Find(What:=Value, MatchCase:=True)
End Function
Function FindValueType(TypeValue As String) As Range
'Variablen Aangeven
Dim SearchRange As Range
Dim Start As Range
Select Case Producent_cbo
Case "Ammeraal Beltech"
Set SearchRange = Berekeningen.Range("I11", Berekeningen.Range("I11").End(xlDown))
Case "Habasit"
Set SearchRange = Berekeningen.Range("N11", Berekeningen.Range("N11").End(xlDown))
Case "Intralox"
Set SearchRange = Berekeningen.Range("S11", Berekeningen.Range("S11").End(xlDown))
End Select
' Set SearchRange = Berekeningen.Range(Start, Start.End(xlToRight))
Set FindValueType = SearchRange.Find(What:=TypeValue, MatchCase:=True)
End Function
Private Sub Producent_qm_Click()
MsgBox "In dit keuzemenu dient gekozen te worden welke producent de band levert. Wanneer de producent niet aanwezig is in de lijst wordt de knop 'Band Toevoegen' gebruikt.", vbOKOnly + vbQuestion
End Sub
Private Sub Type_qm_Click()
MsgBox "In dit keuzemenu dient gekozen te worden van welke type de te gebruiken band is. Wanneer het type niet aanwezig is in de lijst wordt de knop 'Band Toevoegen' gebruikt.", vbOKOnly + vbQuestion
End Sub
Private Sub Radius_qm_Click()
MsgBox "In deze tekstbox kan de diameter die de aandrijfrol heeft ingevuld worden. Onder de aandrijfrol is zowel de grootste diamter van een sprocket als de diameter van bijvoorbeeld een trommelmotor te verstaan. Waardes voor de diameter dienen ingevuld te worden in millimeter.", vbOKOnly + vbQuestion
End Sub
Private Sub Band_qm_Click()
MsgBox "In deze tekstbox kan de bandbreedte ingevuld worden. Waardes voor de bandbreedte dienen ingevuld te worden in meter.", vbOKOnly + vbQuestion
End Sub
Private Sub Product_qm_Click()
MsgBox "In deze tekstbox kan het gewicht van een product ingevuld worden. Hiermee worden de producten bedoeld die de conveyor transporteert. Waardes voor het gewicht dienen ingevuld te worden voor het gewicht van één product in kilogram.", vbOKOnly + vbQuestion
End Sub
Private Sub Aantal_qm_Click()
MsgBox "In deze tekstbox kunnen het aantal producten die per meter getransporteerd worden ingevuld worden. Waardes voor het productaantal dienen ingevuld te worden in stuks per meter. Wanneer er 1 product per 2 meter getransporteerd wordt vult men een half in.", vbOKOnly + vbQuestion
End Sub
Private Sub VF_qm_Click()
MsgBox "In deze tekstbox kan de veiligheidsfactor van het koppel ingevuld worden. De tekstbox wordt alleen beschikbaar wanneer de checkbox aangevinkt is. Wanneer de checkbox niet aangevinkt wordt geldt er een veiligheidsfactor van 1.", vbOKOnly + vbQuestion
End Sub
Private Sub Wrijving_qm_Click()
MsgBox "In dit keuzemenu dient gekozen te worden wat de wrijvingscoëfficiënt is. De keuze kan gemaakt worden aan de hand van de materialen die in het keuzemenu aanwezig zijn.", vbOKOnly + vbQuestion
End Sub
Private Sub Aantal_txt_AfterUpdate()
If Aantal_txt.Value <> "" Then
Aantal_txt.BackColor = rgbWhite
Aantal_lbl.ForeColor = Me.ForeColor
End If
End Sub
Private Sub Product_txt_AfterUpdate()
If Product_txt.Value <> "" Then
Product_txt.BackColor = rgbWhite
Product_lbl.ForeColor = Me.ForeColor
End If
End Sub
Private Sub Band_txt_AfterUpdate()
If Band_txt.Value <> "" Then
Band_txt.BackColor = rgbWhite
Band_lbl.ForeColor = Me.ForeColor
End If
End Sub
Private Sub Radius_txt_AfterUpdate()
If Radius_txt.Value <> "" Then
Radius_txt.BackColor = rgbWhite
Radius_lbl.ForeColor = Me.ForeColor
End If
End Sub