>Hello
>
[quoted text clipped - 30 lines]
>
>Jessus Bless
How about something like this <<< Air Code >>>
Function Combined(Invinitiv As String, Im1 As String) As String
Dim MyArray()
If Left$(Im1, 1) = "-" Then
'-- Combine both strings
If InStr(1, Invinitiv, "|") > 0 Then
'-- It has a "|", use the string before the "|"
MyArray = Split(Invinitiv, "|")
Else
'-- Use the complete first string
MyArray = Split(Invinitiv)
End If
Combined = Trim(MyArray(0)) & Left$(Im1, 2)
Else
'-- Just use the complete second string
Combined = Im1
End If
End Function
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
Jemsson - 19 Dec 2005 09:56 GMT
Hello
Thank you for this code you wrote.
I created new Module with name Combined and paste this code on it.
So how I bring the result on the field ?
I make Filed and write inside it:
= Combined
and tested with this:
= Combined (Invinitiv, Im1)
I even paste the code on the field Control Source, but it didn’t work too.
Can you please explain it such as where this code will I paste and what I
have to write on the form field ?
Jessus Bless
RuralGuy - 19 Dec 2005 15:10 GMT
To start, do *not* name the module "Combined". Access will get confused when
the module and the function are the same. Name it *anything* else.
Create a new TextBox on your form and set the ControlSource to:
=Combined([Invinitiv], [Im1])
If Invinitiv and Im1 are your field names.
>Hello
>
[quoted text clipped - 14 lines]
>
>Jessus Bless
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
Jemsson - 19 Dec 2005 21:28 GMT
Hello
First I would like to thank you very much for this code.
I tested it and it give great result, but there is only little part give not
correct result
You wrote this part of code:
Combined = Trim(MyArray(0)) & left$(Im1, 2)
And when [Im1] is "-de" so should remove "-" and then other chracter will
show, but in this code it show LEFT first two chracter only. Wich mean "-" +
"1" chracter
Ex.
[Im1] = -dar
MyArray(0) = hej
Result be now = hej-d
though result should be = hejdar
Do you thing man can make this code so:
left$(Im1, delete first chracter then show all)
or
Right$(Im1, all chracter - 1 lsat chracter)
If there is other way man can write this part of code?
Because only this part need change: left$(Im1, 2)
Thanks alot
RuralGuy - 20 Dec 2005 03:13 GMT
Oops. Sorry, it should be:
Combined = Trim(MyArray(0)) & Mid(Im1, 2)
>Hello
>
[quoted text clipped - 27 lines]
>
>Thanks alot
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
Jemsson - 20 Dec 2005 22:04 GMT
Thank you very much
Jesus Bless