Hi
I've have a form with 15 fields for user to update the data. Sometimes, the user enters with leading or trailing spaces and it creates problem when I use them to lookup. I try the following to trim one of the fields (using AfterUpdate), it fails:
QUOTE
<tbody id="yui_3_16_0_ym19_1_1471391075601_2577" style="-webkit-padding-start: 0px; width: 392px;">
</tbody>UNQUOTE
Please advise how to fix:
1. how to use one vba to apply to all fields or I need create vba for each in the control
2. some fields in the table do not show trailing spaces but in the form, it shows. I don't know why.
Regards
I've have a form with 15 fields for user to update the data. Sometimes, the user enters with leading or trailing spaces and it creates problem when I use them to lookup. I try the following to trim one of the fields (using AfterUpdate), it fails:
QUOTE
Private Sub F_Name_AfterUpdate() |
Me.F_Name = Trim([F_Name]) |
Do While InStr([F_Name], " ") > 0 |
Me.F_Name = Replace([F_Name], _ |
" ", " ", 1, -1, vbTextCompare) |
Loop |
End Sub |
<tbody id="yui_3_16_0_ym19_1_1471391075601_2577" style="-webkit-padding-start: 0px; width: 392px;">
</tbody>
Please advise how to fix:
1. how to use one vba to apply to all fields or I need create vba for each in the control
2. some fields in the table do not show trailing spaces but in the form, it shows. I don't know why.
Regards