Hi guys, I do have a huge problem with my db,
I try to run a code, but I don't know why it comes up a runtime error 2147217900 (80040e14)
I've been looking for days for a solution, I tried to check on the internet, and someone (also in this forum) had this problem. Even if I try, I can't see any mistake in my code... could you please give it a check? I yellowed the part highlighted during the debug. thank guys
___________________________________________________________
Private Sub Assegnato_BeforeUpdate(Cancel As Integer)
Dim sqlCmd As String, nomecampo As String
If Assegnato.Value <> Assegnato.Tag Then
Select Case Assegnato.Tag
Case "Uff Val Cedenti": nomecampo = "Data Fine Val Cedenti"
Case "Resp Val Cedenti": nomecampo = "Data Fine Resp Val Cedenti"
End Select
sqlCmd = "UPDATE [DatePratiche] SET [DatePratiche].[" & _
nomecampo & "] = Date() " & _
"WHERE ([DatePratiche].NDG)= " & CStr(NDG)
CurrentProject.Connection.Execute sqlCmd
Select Case Assegnato.Value
Case "Uff Val Cedenti": nomecampo = "Data Inizio Val Cedenti"
Case "Resp Val Cedenti": nomecampo = "Data Inizio Resp Val Cedenti"
End Select
sqlCmd = "UPDATE [DatePratiche] SET [DatePratiche].[" & _
nomecampo & "] = Date() " & _
"WHERE ([DatePratiche].NDG)= " & CStr(NDG)
CurrentProject.Connection.Execute sqlCmd
End If
End Sub
I try to run a code, but I don't know why it comes up a runtime error 2147217900 (80040e14)
I've been looking for days for a solution, I tried to check on the internet, and someone (also in this forum) had this problem. Even if I try, I can't see any mistake in my code... could you please give it a check? I yellowed the part highlighted during the debug. thank guys
___________________________________________________________
Private Sub Assegnato_BeforeUpdate(Cancel As Integer)
Dim sqlCmd As String, nomecampo As String
If Assegnato.Value <> Assegnato.Tag Then
Select Case Assegnato.Tag
Case "Uff Val Cedenti": nomecampo = "Data Fine Val Cedenti"
Case "Resp Val Cedenti": nomecampo = "Data Fine Resp Val Cedenti"
End Select
sqlCmd = "UPDATE [DatePratiche] SET [DatePratiche].[" & _
nomecampo & "] = Date() " & _
"WHERE ([DatePratiche].NDG)= " & CStr(NDG)
CurrentProject.Connection.Execute sqlCmd
Select Case Assegnato.Value
Case "Uff Val Cedenti": nomecampo = "Data Inizio Val Cedenti"
Case "Resp Val Cedenti": nomecampo = "Data Inizio Resp Val Cedenti"
End Select
sqlCmd = "UPDATE [DatePratiche] SET [DatePratiche].[" & _
nomecampo & "] = Date() " & _
"WHERE ([DatePratiche].NDG)= " & CStr(NDG)
CurrentProject.Connection.Execute sqlCmd
End If
End Sub