"galsaba" <ga*****@aol.com> ha scritto nel messaggio
news:11**********************@o13g2000cwo.googlegr oups.com...
I have a field called "notes".
I want to seperate this field to two and more.
the carachater "#" indicates the begining of a new field.
For example:
if "notes" is:
"My name is John # the name of my friend is jim # jim leaves in NY#"
In the new table (or query) I want to see:
Under the field "Notes": "My name is John"
Under the (new) field "Notes1": "the name of my friend is Jim"
Under the (new) field "Notes2": "jim leaves in NY"
Is it possible to seperate the field "notes" to three fields? How?
Thanks,
galsaba
Example:
I have 2 field: CAP and another...
In a vba module declare the function...
Public Function DividiIndirizzo(IndirizzoUnico As String, PrimaDopo As
Integer) As String
Dim Conta As Integer
Dim Conta2 As Integer
Dim Pippo As String
DividiIndirizzo = ""
For Conta = 1 To Len(IndirizzoUnico) - 5
Pippo = ""
For Conta2 = 0 To 4
If IsNumeric(Mid(IndirizzoUnico, Conta + Conta2, 1)) Then
Pippo = Pippo & Mid(IndirizzoUnico, Conta + Conta2, 1)
End If
Next Conta2
If Len(Pippo) = 5 Then
If PrimaDopo = 1 Then
DividiIndirizzo = Left(IndirizzoUnico, Conta - 1)
Exit Function
Else
DividiIndirizzo = Mid(IndirizzoUnico, Conta)
Exit Function
End If
End If
Next Conta
End Function
-----------------
create a query with sql...
SELECT Tabella1.TuttoInsieme, DividiIndirizzo([TuttoInsieme],1) AS Campo1,
DividiIndirizzo([TuttoInsieme],2) AS Campo2
FROM Tabella1;-----------------Ok?