I'm getting a compiling error when I try to run this.
A compile error is one that occurs when you try to compile the project. When you get an error during code execution, it is a run-time error - the distinction is important. I'm going with the assumption it's a run-time error since you say it occurs when you try to run it.
It's highlighting the first line (private sub ConfOk_Click).
Often, the first line is yellow and there is also a different highlight on the offending line further down, although not always.
I don't know how to answer the name of the sub/function question
I'm asking if the name of the sub or function that is 'undefined' is part of the message. I was hoping your answer would be "Update Users". It looks like you're not only trying to use an incorrect construct for a sql (where Access thinks Update Users is a call to an unrecognized procedure) but you are expecting it to run when execution gets there (it will not). This would explain the error message.
If that is not a procedure call, but it's a sql statement that works when you dump it into a new test query, then you either have to use line continuation characters or concatenate the sql statement while assigning it to a variable, THEN code to run it (note I did not say Execute it - that is for Action Queries). I very much dislike line continuation characters, so I will show you my way and leave you to research the other and decide which to use.
Code:
Dim sql as String
'some would preface this name with the variable type (svSql, strSql, etc) I think it's universally accepted that sql is a string
'however, it is a clue for you to research naming convention (as well as reserved names, per my comment on the name FIRST)
sql = Update Users Set Password = Forms!NewPass.NewP.Value Where "
sql = sql & "UserName = Forms!UserLogin.tbUsername.Value Set First = 0 Where "
sql = sql & "UserName = Forms!UserLogin.tbUsername.Value"
Value is not necessary. It's the default property of controls that contain values.
Forms!UserLogin! - I recommend you use the ! to denote objects which have collections (such as the Forms! collection) and the period where the ! is not required. Both should work, but a mis-spelled control name (!NewwP) won't be caught until run time; .NewwP will be caught during a compile.
If you adopt this concatenation method, be consistent. Either end with a required space OR start with one. I prefer the former.
Once the sql concatenation is complete, you must tell Jet to run it:
There are other ways to accomplish this task (such as Docmd.RunSql ("sql string here") if short or with a whole bunch continuation characters if it's not.
If Update Users is in fact a procedure call, Access can't find it. I hope it is not, otherwise I've written a lot for little gain.