Hi
I have a problem. I would like to update a field in a dataset only when it's different to the value in the form.
I saw that it passed as if it was different. I put messages boxes to see if they were different but it seems like it's the same. Does somebody understand why it does this?
MsgBox("'" & dr.Item("Job_type") & "'") = 'Nothing'
MsgBox("'" & Me.JobType.SelectedValue & "'") = 'Nothing'
MsgBox(Len(dr.Item("Job_type"))) = 7
MsgBox(Len(Me.JobType.SelectedValue)) = 7
If Me.JobType.SelectedValue <> Nothing Then
If dr.Item("Job_type") <> Me.JobType.SelectedValue Then dr.Item("Job_type") = Me.JobType.SelectedValue
Else
If dr.Item("Job_type") <> "" Then dr.Item("Job_type") = ""
End If
I have a problem. I would like to update a field in a dataset only when it's different to the value in the form.
I saw that it passed as if it was different. I put messages boxes to see if they were different but it seems like it's the same. Does somebody understand why it does this?
MsgBox("'" & dr.Item("Job_type") & "'") = 'Nothing'
MsgBox("'" & Me.JobType.SelectedValue & "'") = 'Nothing'
MsgBox(Len(dr.Item("Job_type"))) = 7
MsgBox(Len(Me.JobType.SelectedValue)) = 7
If Me.JobType.SelectedValue <> Nothing Then
If dr.Item("Job_type") <> Me.JobType.SelectedValue Then dr.Item("Job_type") = Me.JobType.SelectedValue
Else
If dr.Item("Job_type") <> "" Then dr.Item("Job_type") = ""
End If