nanscombe
Registered User.
- Local time
- Today, 08:31
- Joined
- Nov 12, 2011
- Messages
- 1,082
I remembered that you can't get zip files, hence unzipped Db
Right, I've adjusted the code to deal with single hour digit and double hour digit by checking for both and picking the one closest to the beginning of the string, assuming they exist.
The new function looks like this.
I have also adjusted the table and field names to cater for your situation and included a couple of example queries to show how I manipulate the data.
I update field [NBS Update] (you can wrap [] around names with spaces in them) with the manipulated version of itself (query qryUpdateExample).
I then use the contents field theMemo to reset [NBS Update] to its original version. (query qryResetExample)
I hope this works Ok.
Right, I've adjusted the code to deal with single hour digit and double hour digit by checking for both and picking the one closest to the beginning of the string, assuming they exist.
The new function looks like this.
Code:
Public Function addCrLfBeforeDate(ByVal theString As String)
Dim strTemp As String, lngFound As Long, lngFoundN As Long, lngFoundNN As Long, strResult As String
Dim strFingerPrint As String
strFingerPrint = strFingerprintGet(theString)
strResult = vbNullString
strTemp = theString
lngFound = 0
Do
lngFoundN = InStr(10, strFingerPrint, "NNNN/NN/NN N:NN:NN AA")
lngFoundNN = InStr(10, strFingerPrint, "NNNN/NN/NN NN:NN:NN AA")
lngFound = Len(strFingerPrint)
If (lngFoundNN > 0) And (lngFoundNN < lngFound) Then lngFound = lngFoundNN
If (lngFoundN > 0) And (lngFoundN < lngFound) Then lngFound = lngFoundN
If (lngFoundNN = 0) And (lngFoundNN = 0) Then lngFound = 0
If lngFound = 0 Then
If Len(strResult & vbNullString) > 0 Then strResult = strResult & vbCrLf & vbCrLf
strResult = strResult & strTemp
Exit Do
End If
If Len(strResult & vbNullString) > 0 Then strResult = strResult & vbCrLf & vbCrLf
strResult = strResult & Mid(strTemp, 1, lngFound - 1)
strTemp = Mid(strTemp, lngFound)
strFingerPrint = Mid(strFingerPrint, lngFound)
Loop
addCrLfBeforeDate = strResult
End Function
I have also adjusted the table and field names to cater for your situation and included a couple of example queries to show how I manipulate the data.
I update field [NBS Update] (you can wrap [] around names with spaces in them) with the manipulated version of itself (query qryUpdateExample).
I then use the contents field theMemo to reset [NBS Update] to its original version. (query qryResetExample)
I hope this works Ok.
Attachments
Last edited: