For two days I have tried every combination of code I could find / think of. I have a simple update I want to do to a field, but I am getting a data type miss match error when I set the WHERE to a varable.
Here is what I have;
Dim MyID As Integer
MyID = UserName.GetUse rName()
DoCmd.RunSQL "UPDATE tblEmployees SET [strEmpPassword]='" & Me.txtNewPasswo rd.Value & "' WHERE [lngEmpID] ='" & MyID & "';"
The function GetUserName() works everywhere else I use it. It returns the record ID number for the user.
I can replace the MyID in the SQL statement to a number and it works. I have also replaced UserName.GetUse rName() with a number and it breaks the SQL query also. I just do not know where to go from here. Any help would be great.
Here is what I have;
Dim MyID As Integer
MyID = UserName.GetUse rName()
DoCmd.RunSQL "UPDATE tblEmployees SET [strEmpPassword]='" & Me.txtNewPasswo rd.Value & "' WHERE [lngEmpID] ='" & MyID & "';"
The function GetUserName() works everywhere else I use it. It returns the record ID number for the user.
I can replace the MyID in the SQL statement to a number and it works. I have also replaced UserName.GetUse rName() with a number and it breaks the SQL query also. I just do not know where to go from here. Any help would be great.
Comment