Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / December 2005

Tip: Looking for answers? Try searching our database.

Field form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jemsson - 18 Dec 2005 09:24 GMT
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
RuralGuy - 18 Dec 2005 16:04 GMT
>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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.