Hi,
I am trying to insert a new row of data into the table UserTable if the UserLogin is not found in the table. When i run the coding, an error appear. Compile error: Expected Expression. May i ask how do i solve this problem?
Following is my coding:
If isnull ( select [UserLogin] from UserTable where [UserLogin] like me.txtLogin.value ) then
CurrentDb.execute "insert into UserTable (Username, UserLogin, UserPass) values ( '" & me.txtName.value & "', '" & me.txtLogin.value & '",'" & me.txtPass.value & "')
Else
Magnox "User is already in Table"
End if
I am trying to insert a new row of data into the table UserTable if the UserLogin is not found in the table. When i run the coding, an error appear. Compile error: Expected Expression. May i ask how do i solve this problem?
Following is my coding:
If isnull ( select [UserLogin] from UserTable where [UserLogin] like me.txtLogin.value ) then
CurrentDb.execute "insert into UserTable (Username, UserLogin, UserPass) values ( '" & me.txtName.value & "', '" & me.txtLogin.value & '",'" & me.txtPass.value & "')
Else
Magnox "User is already in Table"
End if