Wah, semangat 45 nih.
Good.

Gak hanya  untung beliung britama yg kasih kejutan berkali-kali, tap engkong
akses ini juga.

Yang mo cepat sakti kudu buruan nih, supaya semangat tetap terjaga.

Good luck and see you there...

Haer Talib


On Mon, Feb 9, 2009 at 9:30 PM, privat access <[email protected]> wrote:

>  Contoh kode untuk form login
> (Merupakan salah satu diantara "KEJUTAN" Training ICDP-2009)
>
>
> Private Sub cmdlogin_Click()
> On Error GoTo Err_cmdlogin_Click
> Dim stDocName As String
> Dim stLinkCriteria As String
> If IsNull([cbouser]) Then
>     MsgBox "Nama user belum di-isi!", vbCritical, "Peringatan"
>     cbouser.SetFocus
>     ElseIf IsNull([txtpassword]) Then
>              MsgBox "Password belum di-isi", vbCritical, "Peringatan"
>              txtpassword.SetFocus
>              ElseIf Me![txtpassword].Value <> Me![txtpass].Value Then
>                       If Me![counter] = 1 Then
>                           Dim strpsn As String
>                           strpsn = "Hak akses tidak dikenal!" + Chr(13)
>                           strpsn = strpsn + "Silahkan hubungi
> Admin/Programmer!!!"
>                           MsgBox strpsn, vbCritical, "Peringatan"
>                           DoCmd.Quit
>                           Else
>                                 MsgBox "Username/Password salah. Silahkan
> coba sekali lagi!", vbCritical, "Peringatan"
>                                 Me![counter] = Me![counter] + 1
>                                 Me![txtpassword] = ""
>                                 txtpassword.SetFocus
>                      End If
>     Else
>
>     Me.Bar.Visible = True
>     Me.TimerInterval = 25
>     Call run_bar
>
> End If
>
>
>
> Exit_cmdlogin_Click:
>     Exit Sub
> Err_cmdlogin_Click:
>     MsgBox Err.Description
>     Resume Exit_cmdlogin_Click
>
> End Sub
>
> -----------------------------------------------------------------------------------------------
>
> Private Sub run_bar()
> On Error GoTo nol
>
> Dim MainMenu As String
>
> If Me.status.Value = "Admin" Then
>    MainMenu = "Main"
>    Else
>        MainMenu = "Main2"
> End If
>
>     DoCmd.Hourglass True
>     Bar.Value = Bar.Value + 1
>     If Bar.Value = 100 Then
>         Form.TimerInterval = 0
>         DoCmd.Hourglass False
>         MsgBox "Proses Login Berhasil !", , "Login Sukses"
>         DoCmd.Close acForm, "frmLogin"
>         DoCmd.OpenForm MainMenu
>         DoCmd.Maximize
>     End If
>
> nol:
> End Sub
>
>
>
>
> 
>



-- 
[Haer Talib]
MVP Office Access
Meet me at www.RumahAccess.com

=>

Kirim email ke