Rabu, 13 Juli 2011

Re: [belajar-access] Huruf besar pada awal kata (Proper)

 


Saya belum coba, tapi ini saya dapat dari source internet yang agak lupa sumbernya :

Capitalize first character of every word automatically author(s) Dev Ashish

(Q) How can I capitalize the first character of each word in a field/string?

(A) Under Access 97, you can use the StrConv function.  For example,

    StrConv("dev ashish", vbProperCase)

For Access 2.0, use the Proper function provided by Microsoft.

'******************* Code Begin ****************
Function Proper(X)
' Capitalize first letter of every word in a field.
' Use in an event procedure in AfterUpdate of control;
' for example, [Last Name] = Proper([Last Name]).
' Names such as O'Brien and Wilson-Smythe are properly capitalized,
' but MacDonald is changed to Macdonald, and van Buren to Van Buren.
' Note: For this function to work correctly, you must specify
' Option Compare Database in the Declarations section of this module.
Dim Temp$, C$, OldC$, i As Integer
    If IsNull(X) Then
        Exit Function
    Else
        Temp$ = CStr(LCase(X))
        ' Initialize OldC$ to a single space because first
        ' letter needs to be capitalized but has no preceding letter.
        OldC$ = " "
        For i = 1 To Len(Temp$)
            C$ = Mid$(Temp$, i, 1)
            If C$ >= "a" And C$ <= "z" And _
                (OldC$ < "a" Or OldC$ > "z") Then
                    Mid$(Temp$, i, 1) = UCase$(C$)
            End If
            OldC$ = C$
        Next i
        Proper = Temp$
    End If
End Function
'******************* Code End ****************




hari yanto <har_i20002000@yahoo.com>
Sent by: belajar-access@yahoogroups.com

07/13/2011 06:29 PM
Please respond to belajar-access

       
        To:        belajar-access@yahoogroups.com
        cc:        
        Subject:        Re: [belajar-access] Huruf besar pada awal kata (Proper)



 

Bisa dilihat disini

 
http://www.tek-tips.com/faqs.cfm?fid=5749
 

Semoga bisa membantu dan memberi semangat.

 
Hariyanto (Surabaya)

--- On Wed, 13/7/11, Hendra Agestha Hamid <the_agestha@yahoo.com> wrote:


From: Hendra Agestha Hamid <the_agestha@yahoo.com>
Subject: [belajar-access] Huruf besar pada awal kata (Proper)
To: "belajar-access@yahoogroups.com" <belajar-access@yahoogroups.com>
Date: Wednesday, 13 July, 2011, 6:03 PM

 
Dear Warga Milis,...

Bagaimana caranya agar data yang tersimpan pada tabel (type text) dapat otomatis huruf besar semua pada awal katanya
seperti fungsi Proper pada excel.

Regards
Hendra



__._,_.___
Recent Activity:
SPAM IS PROHIBITED
.

__,_._,___

Tidak ada komentar:

Posting Komentar