Was actually trying some database for my company.
I have Form in which have below feilds:
Field: Rate
Field: ConvertRate
than have 2 Combobox
1st Combobox: Rate per Unit
2nd Combobox: Convert Rate Unit
Now i want to compare 2 Combobox and than get value of ConvertRate
Example
If ComboBox Rate Per Unit value selected kg
and ComboBox Convert Rate Unit value Selected kg too then Field ConvertRate should be equal to Field Rate
but if
ComboBox Convert Rate Unit Value selected m2 than the Feild ConvertRate should calculate (Rate /1000) * gsm (GSM is also Field).
and if ComboBox Convert Rate is other than values mentioned above than the Field ConvertRate should Calculate (Rate / 1000)
Wrote code as under:
Private Sub convert_Unit_Rate_AfterUpdate()
If [convert_Unit_Rate] = [Rate_per_Unit] Then
[ConvertRate] = [Rate]
ElseIf [convert_Unit_Rate] = "m2" And [Rate_per_Unit] = "kg" Then
[ConvertRate] = [Rate] / 1000 * [GSM]
Else
[ConvertRate] = [Rate] / 1000
End If
End Sub
in above code ElseIf part is not working... No Error... kindly suggest....
I have Form in which have below feilds:
Field: Rate
Field: ConvertRate
than have 2 Combobox
1st Combobox: Rate per Unit
2nd Combobox: Convert Rate Unit
Now i want to compare 2 Combobox and than get value of ConvertRate
Example
If ComboBox Rate Per Unit value selected kg
and ComboBox Convert Rate Unit value Selected kg too then Field ConvertRate should be equal to Field Rate
but if
ComboBox Convert Rate Unit Value selected m2 than the Feild ConvertRate should calculate (Rate /1000) * gsm (GSM is also Field).
and if ComboBox Convert Rate is other than values mentioned above than the Field ConvertRate should Calculate (Rate / 1000)
Wrote code as under:
Private Sub convert_Unit_Rate_AfterUpdate()
If [convert_Unit_Rate] = [Rate_per_Unit] Then
[ConvertRate] = [Rate]
ElseIf [convert_Unit_Rate] = "m2" And [Rate_per_Unit] = "kg" Then
[ConvertRate] = [Rate] / 1000 * [GSM]
Else
[ConvertRate] = [Rate] / 1000
End If
End Sub
in above code ElseIf part is not working... No Error... kindly suggest....