Access login system using a macro -
i have issue code in when click on submit button of login form, error comes back.
the error "the object doesn't include automation object 'tbl_tutor.'"
it shows part of code causing error;
[forms]![frm_login]![username]=[tbl_tutor]![username]
this part of code check username in username field of table tbl_tutor, cannot work.
but have no idea how go fixing issue. have 2 seperate tables login system, there teacher , tutor table , each have seperate login username , password , selected on dropdown on form, username , password put in, form lookup if information correct. code wrong i'm not experienced in access (this level exam , haven't been taught how use access well).
the full code shown below;
if [forms]![frm_login]![typeselect]="personal tutor" if [forms]![frm_login]![username]=[tbl_tutor]![username] if [forms]![frm_login]![password]=[tbl_tutor]![password] else messagebox message incorrect username or password, please try again. beep yes type none title username or password incorrect end if end if end if
then same below teacher table well.
any on issue appreciated :)
since vba code in frmlogin
form, correct way reference using name of control. leave out forms!frmlogin
.
the reason getting error because trying access values tbl_tutor
table wrong way.
use dlookup
function access table.
e.g.: dlookup("username","tbl-tutor","username = '" & me.username & "'")
Comments
Post a Comment