I have earlier posted this problem, but I have not received requisite response
In my application I wanted to assigned user specific job such EDIT, DELETE and ADD.
Following users:-
1= admin (only one person)
this will ADD, DELETE, EDIT records
2= manager (only one person)
this will only ADD & EDIT records (DELETE button will be disabled)
3= chemist (there are 8 persons)
this will only ADD records (Delete/Edit button will be disabled)
I have written following code to add username and password for three different user
Private Sub ommand1_click()
Set rst= new ADODB.recordset
Rst.open “mypass”,conn,……………………..
With rst
If combo1.text= 1 and .Recordcount < 1 then
.Addnew
!jobttile=combo1.text
!username=text1.text
!password=text2.text
.update
.requery
else
msgbox “ U cannot add new record”,vbinformation
exit sub
end if
If combo1.text= 2 and .Recordcount < 1 then
.Addnew
!jobttile=combo1.text
!username=text1.text
!password=text2.text
.update
.requery
else
msgbox “ U cannot add new record”,vbinformation
exit sub
end if
If combo1.text= 3 and .Recordcount < 8 then
.Addnew
!jobttile=combo1.text
!username=text1.text
!password=text2.text
.update
.requery
else
msgbox “ U cannot add new record”,vbinformation
exit sub
end if
But my problem is when I add one record for 1 =admin it is added but when i want to add second record for 2 = manager it is not added instead giving message “u cannot add new records”.
How to sort out this problem
