Unanswered: Going crazy! Help with quotes in a where statement
I have this is a different thread with an obscure title. I have two functions to log when people sign in and out of a multiuser database. When it works it will allow me to see who is still in a database so I can have them shut down so I can do maintenance. My first function is fine DB_Opencode() works perfectly as it just adds a new record and closes (no one sees this happen).
the above works just fine (to create table and form just copy the fieldnames and make time_in and Time_Out as date time and the last field that combines the other 4 at 255. That way you can see if it works for you first. My second function Below does not work as I can not figure out the quotes properly. The fld6v when put in immediate window and debug.print does come up correctly but when put in the openform where clause will not work at all as it filters nothing on the form.
Dim fld6V As String
fld6V = CurrentUser & " -- " & Environ("UserName") & " -- " & Environ("Computername") & " -- " & Environ("Userdomain")
DoCmd.OpenForm "UseLogger_Frm", acNormal, , "[Forms]![UseLogger_Frm].[DBL_NLN_NMN_ND] = '"fld6V"'", acFormEdit, acHidden
[Forms]![UseLogger_Frm].[Time_Out] = Now()
Forms!UseLogger_Frm.Dirty = False
Forms!UseLogger_Frm.Visible = True
Any and all help would be appreciated.
I have tried just about every combination of  and & and whatever else I could think of and it either filters nothing and adds a new record with nothing but a Time_out (which is useless to me) or it says it cant find the form, or syntax error (missing operator) or some type mismatch. I've seen it all.
Looks like the problem is with the WHERE clause in your OpenForm line. You shouldn't have to put [Forms]![UseLogger_Frm] in the clause, and you're also missing the & symbols to concatenate your fld6V variable with. Try this instead: