MS Access VB command help

csdrex87

Registered User.
Local time
Today, 14:35
Joined
Jul 1, 2009
Messages
66
So I'm creating my own user-level security thing and I have some basic code experience but not much. Anyway what I have right now is a if statement to check the password put into the Access form against the password in the table.
What i need help with now is saving that particular password which is currently in the location " & Form![Emp_password]" to the table location "[Password]", "tblEmployeeInformation"

can anyway help provide me with either the command to save only one particular piece of in formation or a full command line to achieve my goal?
 
use an UPDATE query to do it:
Code:
currentdb.execute "UPDATE YourTable SET " & _
   "YourField = Forms!Form!Emp_password WHERE " & _
      "[UserID] = " & PlaceWhereIdentifierIsInYourForm
 
Hey,

So i tried to use an update query applied it to an onclick button and what not. This was the final code that i put in
CurrentDb.Execute "UPDATE tblEmployeeInformation SET " & _
" Emp_Password = Forms!formEmployeeInformation!Emp_password WHERE " & _ "[Emp_ID] = " & Emp_ID

The table i have the password in is tblEmployeeInformation
The column in that table is named Emp_Password
The form name is formEmployeeInformation
and the place in the form where i have them ID is Emp_ID and likewise Emp_Password for Emp_Password.

My problem is that this still doesn't change the password in the table after the user inputs their password.



Thanks for helping btw
 
You have not parsed the sql correctly

it should read

Code:
CurrentDb.Execute "UPDATE tblEmployeeInformation SET " & _
" Emp_Password = '" & Forms!formEmployeeInformation!Emp_password & "'  WHERE [Emp_ID] = " & Emp_ID
 

Users who are viewing this thread

Back
Top Bottom