You are on page 1of 1

Sekedar buat tambahan referensi rekan2 programmer : Coded by : Fathur - SuryaSoft Banjarmasin fathur72@yahoo.com 1.

Pindah antar textbox/ComboBox dengan hanya 1 baris perintah: Kode pada form : Private Sub Text1_KeyPress(KeyAscii As Integer) PindahTab KeyAscii End Sub

Letakkan pada module : Public Sub PindahTab(nTab As Integer) If nTab = 13 Then SendKeys "{tab}" End If End Sub

2. Kode Rata Kanan/Rata Kiri Letakkan pada Module Public Function PadL(cChar as String, nSpace As Integer) As String Dim nSpace1 As Integer If Len(cChar) <> nSpace Then If Len(cChar) > nSpace Then PadL = Right(cChar, nSpace) Else PadL = Space(nSpace - Len(cChar)) + cChar End If Else PadL = cChar End If End Function Public Function PadC(cChar As String, nSpace As Integer) As String Dim nSpace1 As Integer If Len(cChar) <> nSpace Then If Len(cChar) < nSpace Then nSpace1 = nSpace - Len(cChar) PadC = Space(nSpace1 / 2) + cChar + Space(nSpace1 / 2) Else PadC = Right(cChar, nSpace) End If Else PadC = cChar End If End Function

You might also like