Hi,
I have a table that consist some special accent character like letter ő.
This can be entered into table and shows up correctiy in forms. For some pdf savings i wanted to have accentless characters for file name so i found and use a function for this
Public Function RemoveAccents(ByVal inputString As String) As String
Const accentString As String = "ÁáÉéÓóÖöŐőÚúŰű"
Const nonAccentStr As String = "AaEeOoOoOoUuUu"
Dim i As Integer
For i = 1 To Len(accentString)
inputString = Replace(inputString, Mid(accentString, i, 1), _
Mid(nonAccentStr, i, 1), , , vbBinaryCompare)
Next i
RemoveAccents = inputString
End Function
This works perfectly except with character ő. If data is taken from form control it fails however if i use RemoveAccents("ő") it works.
Why? It seems Access automatically changes something despite it shows up correctly in table/form. Interestingly Dlookup function also fails if character ő is used in the where condition.
Thank you
I have a table that consist some special accent character like letter ő.
This can be entered into table and shows up correctiy in forms. For some pdf savings i wanted to have accentless characters for file name so i found and use a function for this
Public Function RemoveAccents(ByVal inputString As String) As String
Const accentString As String = "ÁáÉéÓóÖöŐőÚúŰű"
Const nonAccentStr As String = "AaEeOoOoOoUuUu"
Dim i As Integer
For i = 1 To Len(accentString)
inputString = Replace(inputString, Mid(accentString, i, 1), _
Mid(nonAccentStr, i, 1), , , vbBinaryCompare)
Next i
RemoveAccents = inputString
End Function
This works perfectly except with character ő. If data is taken from form control it fails however if i use RemoveAccents("ő") it works.
Why? It seems Access automatically changes something despite it shows up correctly in table/form. Interestingly Dlookup function also fails if character ő is used in the where condition.
Thank you