I have some code that updates a record's fields based on a selection from a list box (lstDelFrom). The user selects the record from the list box & it copies it into the fields [seg], [other], [name] etc.
My problem is that the code only works if all the fields that are being copied from have information in them. It does not work when some of the fields are null such as [seg] & [other] which is often the case.
sql = "update delegation " & _
"Set [delegation].[seg] = '" & lstDelFrom.Colu mn(1) & "'," & _
"[delegation].[other] = '" & lstDelFrom.Colu mn(2) & "'," & _
"[delegation].[name] = '" & lstDelFrom.Colu mn(3) & "'," & _
"[delegation].[title] = '" & lstDelFrom.Colu mn(4) & "'," & _
"[delegation].[section] = '" & lstDelFrom.Colu mn(5) & "'" & _
"Where ([delegation].[id] = '" & [Forms]![frmdelnewproper ties]![id] & "')"
Is there a way to handle this situation. Thanks in advance.
My problem is that the code only works if all the fields that are being copied from have information in them. It does not work when some of the fields are null such as [seg] & [other] which is often the case.
sql = "update delegation " & _
"Set [delegation].[seg] = '" & lstDelFrom.Colu mn(1) & "'," & _
"[delegation].[other] = '" & lstDelFrom.Colu mn(2) & "'," & _
"[delegation].[name] = '" & lstDelFrom.Colu mn(3) & "'," & _
"[delegation].[title] = '" & lstDelFrom.Colu mn(4) & "'," & _
"[delegation].[section] = '" & lstDelFrom.Colu mn(5) & "'" & _
"Where ([delegation].[id] = '" & [Forms]![frmdelnewproper ties]![id] & "')"
Is there a way to handle this situation. Thanks in advance.
Comment