George, Thanks for the reply. Your solution is very good. It is somewhat more general purpose than mine. I wasn't very clear in my question. What I really want to know is whether on not the VB.NET capabilities like "Replace" are available in Access VB (including RegEx). Dick
--- In [email protected], "George Oro" <[EMAIL PROTECTED]> wrote: > > Not sure if this will work in VBA.net but most probably. > Paste this code to a new module, basically this is the replacement of the > Replace built-in function: > > '// Syntax is same as Replace > > hth, > George > > PS. I believe this is the 3rd time I poste this code... sorry ;D > > > > Function FindAndReplace(ByVal strInString As String, _ > strFindString As String, _ > strReplaceString As String) As String > Dim intPtr As Integer > > '***DEBUG.PRINT strInString > > If Len(strFindString) > 0 Then 'catch if try to find empty string > Do > intPtr = InStr(strInString, strFindString) > If intPtr > 0 Then > FindAndReplace = FindAndReplace & Left(strInString, intPtr - > 1) & _ > strReplaceString > strInString = Mid(strInString, intPtr + > Len(strFindString)) > End If > Loop While intPtr > 0 > End If > FindAndReplace = FindAndReplace & strInString > > End Function > > > > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] > Behalf Of d1ckroot > Sent: Sunday, November 05, 2006 11:22 PM > To: [email protected] > Subject: [ms_access] string manipulation in Access VBA? > > > All, > I am using a barcode scanner to input book data into Access. Using > the barcode, I compute the ISBN including the check digit. But, when > the barcode is unreadable I want to allow the user to input the ISBN > instead. I have already solved the problem by using a series of "Mid" > instructions. But, I was researching string manipulation and ran > across it in VBA.net. There are many string manipulation functions > there. So I experimented with taking out the dashes "WorkStr = > ISBN("-", "")" My Access told me there was no such thing as > "Replace". Is there a way for me to utilize these .net methods? > Also, does anybody have a good simple example of RegEx in Access VBA. > Dick > > > > > > > Yahoo! Groups Links > Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/ms_access/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/ms_access/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
