Access rights!!!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • THEAF
    New Member
    • Mar 2007
    • 52

    Access rights!!!!

    hi,
    im trying to create access rights on my project. i have a form with check boxes so when ticked it will dissable the user from having access to that area, i am using a list box with this so you can select the access rights for different users. the thing is i keep getting problems. this is my list code:

    LISTBOX
    [code=vb]
    rs2.FindFirst "StaffID=" & Str(List1.ItemD ata(List1.ListI ndex))

    Text1.Text = rs2!StaffID
    chkStaff.Value = rs!Staff
    chkBooking.Valu e = rs!Booking
    chkStock.Value = rs!Stock
    chkIncome.Value = rs!Income
    chkPayment.Valu e = rs!Payment
    chkLogin.Value = rs!Login
    chkContact.Valu e rs!Contact
    Text1.Text = rs!User
    [/code]
    FORMLOAD

    [code=vb]
    Dim db As Database
    Dim rs As Recordset
    Dim rs2 As Recordset
    Dim db2 As Database
    Form_load
    Set db2 = OpenDatabase("E :\skol\A2 Computing\Speed y Pizza database.mdb")
    Set rs2 = db2.OpenRecords et("Staff", dbOpenDynaset)
    If Not rs2.EOF Then rs2.MoveFirst

    Do While Not rs2.EOF
    List1.AddItem rs2!StaffID
    List1.ItemData( List1.NewIndex) = rs!StaffID
    rs.MoveNext
    Loop

    Set db = OpenDatabase("E :\skol\A2 Computing\Passw ord.mdb")
    Set rs = db.OpenRecordse t("Access_Right s", dbOpenDynaset)
    If Not rs.EOF Then rs.MoveFirst

    Do While Not rs.EOF
    rs.MoveNext
    Loop
    [/code]
    im trying to get info from one table add some info from another table and save this on a new table. I keep getting the error "object variable or with block not set"
    can you please help. Can anyone think of an SQL statement that i can use.
    THANK YOU
    Last edited by debasisdas; Feb 15 '08, 01:53 PM. Reason: added code=vb tags
  • Bum
    New Member
    • Jan 2008
    • 19

    #2
    are you adding a reference to the Microsoft Office [version] Access Library?

    Comment

    • THEAF
      New Member
      • Mar 2007
      • 52

      #3
      Originally posted by Bum
      are you adding a reference to the Microsoft Office [version] Access Library?
      Sorry but i don't get what your sayin.
      are you sayin if im using the reference Microsoft Office Access Library or somfing.

      Comment

      • lotus18
        Contributor
        • Nov 2007
        • 865

        #4
        At which line do you get an error?

        Comment

        Working...