Hargreavesk
Technical User
Can anyone help?
I have a currency field called "Amount". I would like to convert the decimal point in this field to a hyphen in a field called "Amount1". My data is this £136.00 but I would like it to look like this 136-00. I am using a replace function with the following code:
Function Replace()
Dim Amount As Variant
Dim AmountLeft As String
Dim AmountRight As String
Dim Amount1 As Variant
Amount = Forms![FRM ChequeDetails]!Amount
AmountLeft = Left(Amount, InStr(Amount, "."
- 1) & "-"
AmountRight = Mid(Amount, InStr(Amount, "."
+ 1)
Amount = AmountLeft & AmountRight
Forms![FRM ChequeDetails]!Amount1 = Amount
End Function
This is working fine except for data that has 00 after the decimal point. I have tried everything and am completely baffled. Can anyone help?
Regards
Kate
I have a currency field called "Amount". I would like to convert the decimal point in this field to a hyphen in a field called "Amount1". My data is this £136.00 but I would like it to look like this 136-00. I am using a replace function with the following code:
Function Replace()
Dim Amount As Variant
Dim AmountLeft As String
Dim AmountRight As String
Dim Amount1 As Variant
Amount = Forms![FRM ChequeDetails]!Amount
AmountLeft = Left(Amount, InStr(Amount, "."
AmountRight = Mid(Amount, InStr(Amount, "."
Amount = AmountLeft & AmountRight
Forms![FRM ChequeDetails]!Amount1 = Amount
End Function
This is working fine except for data that has 00 after the decimal point. I have tried everything and am completely baffled. Can anyone help?
Regards
Kate