Here is the code, easier to read:
ssql =
"update x_task set project_id = " & Me.lstProject &
", task_subcategory_id = " & Me.lstTaskSubType &
", task_description = '" & dbl_quotes(Me.txtTaskNotes) &
"', supervisor_id = " & Me.lstSupervisor &
", lead_id = " & Me.lstLead &
", junior_id = " & Nz(Me.lstJunior, "Null") &
", staffing_notes = '" & dbl_quotes(Me.txtStaffNotes) &
"', task_status_id = " & Me.lstTaskStatus &
", hot_potato_id = " & Nz(Me.lstHotPotato, "Null") &
", task_status_notes = '" & dbl_quotes(Me.txtStatusNotes) &
"', date_edited = date() " &
", date_status_notes_edited = date() " &
"where task_id = " & Me.lstTask
After a record is updated a first time with junior_id=Null, if I try to
update the record a second time without touching the empty junior Id list
box, the output is "junior_id = ," instead of "junior_id=Null".
The double quotes code is just what I was taught - I am using it throughout
the form with no problems. The module is:
If IsNull(str) Then
dbl_quotes = ""
Else
dbl_quotes = Replace(Replace(str, "'", "''"), """", """""")
End If
Also, on a couple of occasions now, when I successfully update a record with
an empty (i.e., Null) hot_potato_id field, the record no longer shows up in
the form when it should (i.e., when I click the button that should populate
the form fields with the record -- it disappears, even though it remains in
the table....
By the way, I am using "MsgBox ssql" for a break -- what command can I use
that will output a string that I can copy and paste?
Thanks again, as always, for all of your help!!