Field form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I would like to know how is the correct code that use inside the filed
called [Imperfekt]

Can you make correct code for this I wrote:

IF [Invinitiv] have " | *" then remove from these " |*" and keep first
part of the word
THEN
if [Im1] start with "-*" then show [Invinitiv] + [Im1] without first
chracter "-"
ElseIf if [Im1] Not have first chracter "-" then Show [Im1]
END IF


Here is ex. number 2:
Invinitiv ---=---> bog | sera
Im1 ---- = ---> -de
Result show like this: bogdede ( take only "bog" without "sera" & "de"
without "-")


Here is ex. number 2:
Invinitiv ---=---> bogsera
Im1 ---- = ---> -de
Result show like this: bogserade (taked [Invinitiv] & [Im1] without "-"
at begning)


Here is ex. number 3:
Invinitiv ----=---> bogsera
Im1 ----=---> hej
Result show like this: hej (it taked only [Im1] becuse there is not "-"
at begning)


Jessus Bless
 
Hello

I would like to know how is the correct code that use inside the filed
called [Imperfekt]

Can you make correct code for this I wrote:

IF [Invinitiv] have " | *" then remove from these " |*" and keep first
part of the word
THEN
if [Im1] start with "-*" then show [Invinitiv] + [Im1] without first
chracter "-"
ElseIf if [Im1] Not have first chracter "-" then Show [Im1]
END IF


Here is ex. number 2:
Invinitiv ---=---> bog | sera
Im1 ---- = ---> -de
Result show like this: bogdede ( take only "bog" without "sera" & "de"
without "-")


Here is ex. number 2:
Invinitiv ---=---> bogsera
Im1 ---- = ---> -de
Result show like this: bogserade (taked [Invinitiv] & [Im1] without "-"
at begning)


Here is ex. number 3:
Invinitiv ----=---> bogsera
Im1 ----=---> hej
Result show like this: hej (it taked only [Im1] becuse there is not "-"
at begning)


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.
 
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
 
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

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
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
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
 
Oops. Sorry, it should be:

Combined = Trim(MyArray(0)) & Mid(Im1, 2)


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
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
Back
Top