Hi everyone,
So I coded IF statements to attach values to particular text entries, for example
Private Sub txtCarType_Enter()
If txtCarType = "Sedan" Then
txtCT = 1
ElseIf txtCarType = "SUV" Then
txtCT = 6.4
ElseIf txtCarType = "Truck" Then
txtCT = 29.2
ElseIf txtCarType = "Full Sized Truck" Then
txtCT = 50
End If
End Sub
Private Sub txtIncreasedCollisionRisk_Enter()
If txtIncreasedCollisionRisk = "None" Then
txtICR = 0
ElseIf txtIncreasedCollisionRisk = "Outage in 1 year" Then
txtICR = 1
ElseIf txtIncreasedCollisionRisk = "1 Outage in next 2 years" Then
txtICR = 0.2
ElseIf txtIncreasedCollisionRisk = "1 Outage in next 10 years" Then
txtICR = 0.1
End If
End Sub
I did this so the textboxes would provide a numerical value in relation to other textboxes text entries, which are all used to make a prioritization number. I made a field for the prioritization number, which is a calculated field, which takes the respective fields that are linked to each textbox that have had IF statements made for them, and adds/subtracts/divides them accordingly, for example:
[Car Type] - [Collision Risk]
Now the actual numbers for the calculation appear in the txtICR and txtCT textboxes, which are linked to fields that separate from the text fields, however the text fields need to be entered with text, then clicked, in order for the number text box to populate, which can then populate the prioritization textbox.
I want the textboxes to create this calculation simply after the text entries are entered, with no clicking necessary. I tried changing the textbox code to Click, Change, etc., but it doesn't make any differences.
Any help with this complicated calculation would be much appreciated.