Assalamu'alaikum Mas Opi dan teman2 yang lain,

Saya udah coba coding dari mas Opi, tapi masih muncul error2 jadi saya balik 
lagi ke coding saya...:D. Sebenernya sudah agak berhasil,  ketika masuk dengan 
user yg aksesnya Admin, menu melakukan aksi yang benar. Tapi ketika saya masuk 
dengan user yg aksesnya User, kenapa menu melakukan action sama seperti ketika 
menggunakan user yg aksesnya Admin ?? Dimana Letak kesalahan coding saya ? Ada 
yang bisa mengkoreksi coding saya ? 

Dim rs As New ADODB.Recordset
Dim Db As New ADODB.Connection
Dim CBarTool As CommandBar

    If IsNull(Me.Tkodeuser) Or Me.Tkodeuser = "" Then
            MsgBox "Masukin dulu kode user !.", vbOKOnly, "Data Penting"
            Me.Tkodeuser.SetFocus
        Exit Sub
    End If

    If IsNull(Me.TPassword) Or Me.TPassword = "" Then
            MsgBox "Masukin Passwordnya", vbOKOnly, "Data Penting"
            Me.TPassword.SetFocus
        Exit Sub
    End If

Set Db = CurrentProject.Connection

tSQL = "SELECT kodeuser, password FROM TBUser WHERE kodeuser='" & Me.Tkodeuser 
& "' AND password = '" & Me.TPassword & "'"
rs.Open tSQL, Db, adOpenDynamic, adLockOptimistic
If rs.BOF = True And rs.EOF = True Then
 MsgBox "Kode User atau Password Salah", vbCritical
 Exit Sub
 Me.Tkodeuser.SetFocus
End If

Me.Visible = False

If Not Kosong(Me!kodeuser) Then
    DoCmd.OpenForm "BudiSoftware"
    Set CBarTool = CommandBars("Utama")
    Select Case Me![kodegroup]
      Case "Admin":
          CBarTool.Controls("File").Enabled = True
          CBarTool.Controls("Transaksi").Enabled = True
          CBarTool.Controls("Laporan").Enabled = True
      Case "User":
          CBarTool.Controls("File").Enabled = False
          CBarTool.Controls("Transaksi").Enabled = False
          CBarTool.Controls("Laporan").Enabled = True
      End Select
    
End If

Terima kasih sebelumnya.
Wassalamu'alaikum warahmatullahi wabarakatuh.
Budi




 
Messages in this topic  (8)  Reply  (via web post)  | Start a new topic  
Messages | Files | Photos | Polls 
SPAM IS PROHIBITED 
 
Change settings via the Web (Yahoo! ID required) 
Change settings via email: Switch delivery to Daily Digest | Switch format to 
Traditional 
Visit Your Group  | Yahoo! Groups Terms of Use  | Unsubscribe  
Recent Activity
        *  7
New MembersVisit Your Group  
Yahoo! News
Kevin Sites
Get coverage of
world crises.
Need traffic?
Drive customers
With search ads
on Yahoo!
Real Food Group
Share recipes,
restaurant ratings
and favorite meals.
. 
    

Send instant messages to your online friends http://uk.messenger.yahoo.com 

Kirim email ke