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
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
Comment