I am trying to remove spaces from a postcode field. After searching the various threads I have come across the problem associated with using REPLACE directly in Access so I followed the suggestion of declaring a public function in VB. However there is a compile error (expected identifier) in the code which I do not understand. Please can anyone tell me where my mistake is? - I'm not very confident with VB.
Access 2000
VB v.6
VB code:
Public Function DoReplace(InSightPostcode As String," " As String,"" As String) As String
DoReplace = Replace(InSightPostcode, " ", "")
End Function
Access query:
UPDATE BPCOrInSightTbl SET InSightPostcode = DoReplace(InSightPostcode, " ", "");
Access 2000
VB v.6
VB code:
Public Function DoReplace(InSightPostcode As String," " As String,"" As String) As String
DoReplace = Replace(InSightPostcode, " ", "")
End Function
Access query:
UPDATE BPCOrInSightTbl SET InSightPostcode = DoReplace(InSightPostcode, " ", "");