Hi!
I have written this code to change decimal places. Am I on the right track? On running the code the decimal place remains alway on 4 and does not change to 2 as required by the code. What am I doing wrong? Is there any other setting to be done? Either in the Table or the Forms text box?
Please Help!
Private Sub txtEntryPrice_AfterUpdate()
Dim strA As String
Dim strB As String
Dim strC As String
Dim strG As String
strA = "EUR/USD"
strB = "GBP/USD"
strC = "NZD/USD"
strG = "USD/JPY"
If [cboCurrency] = strG Then
Format ([txtEntryPrice].DecimalPlaces = 2)
End If
If [cboCurrency] = strA Then
Format ([txtEntryPrice].DecimalPlaces = 4)
End If
If [cboCurrency] = strB Then
Format ([txtEntryPrice].DecimalPlaces = 4)
End If
If [cboCurrency] = strC Then
Format ([txtEntryPrice].DecimalPlaces = 4)
End If
End Sub
Orsonros
I have written this code to change decimal places. Am I on the right track? On running the code the decimal place remains alway on 4 and does not change to 2 as required by the code. What am I doing wrong? Is there any other setting to be done? Either in the Table or the Forms text box?
Please Help!
Private Sub txtEntryPrice_AfterUpdate()
Dim strA As String
Dim strB As String
Dim strC As String
Dim strG As String
strA = "EUR/USD"
strB = "GBP/USD"
strC = "NZD/USD"
strG = "USD/JPY"
If [cboCurrency] = strG Then
Format ([txtEntryPrice].DecimalPlaces = 2)
End If
If [cboCurrency] = strA Then
Format ([txtEntryPrice].DecimalPlaces = 4)
End If
If [cboCurrency] = strB Then
Format ([txtEntryPrice].DecimalPlaces = 4)
End If
If [cboCurrency] = strC Then
Format ([txtEntryPrice].DecimalPlaces = 4)
End If
End Sub
Orsonros