A ver si te vale esto.
Dim SQL As String
Call OpenDB
'Set dbs = OpenDatabase(App.Path & "db13.mdb")
If MODIFICACION = False Then
SQL = "INSERT INTO TlbHoras ( HOAÑO, HOSEMANA, HOPERSONA, " & _
"HOPLANTA, HOPROYECTO,HOCAD, HOCAE," & _
"HOGESTION, HOREUNION,HODESPLAZAMIENTO, HOOFERTA, " & _
"HOVARIOS, HOUSUARIOCREACION, HOFECHCREACION )" & _
"SELECT " & Me.Cboaño & ", " & Me.CboSemana & ",'" & MAIL & "', " & _
"'" & PLANTA & "', " & Me.TxtNumeroproyecto & "," & Me.TxtCad & ", " & Me.TxtCae & "," & _
"" & Me.TxtGestion & "," & Me.TxtReunion & "," & Me.TxtDesplazamiento & " ," & Me.TxtOferta & " , " & _
"" & Me.TxtVarios & ",'" & MAIL & "' , Now() ;"
DB.Execute SQL
Else
SQL = "UPDATE TlbHoras SET TlbHoras.HOAÑO = " & Me.Cboaño & ", TlbHoras.HOSEMANA =" & Me.CboSemana & ", TlbHoras.HOPERSONA = '" & MAIL & "'," & _
"TlbHoras.HOPLANTA = '" & PLANTA & "', TlbHoras.HOPROYECTO = " & Me.TxtNumeroproyecto & ", TlbHoras.HOCAD = " & Me.TxtCad & "," & _
"TlbHoras.HOCAE =" & Me.TxtCae & ", TlbHoras.HOGESTION = " & Me.TxtGestion & ", TlbHoras.HOREUNION = " & Me.TxtReunion & ", " & _
"TlbHoras.HODESPLAZAMIENTO = " & Me.TxtDesplazamiento & ", TlbHoras.HOOFERTA = " & Me.TxtOferta & " , TlbHoras.HOVARIOS = " & Me.TxtGestion & "," & _
"TlbHoras.HOUSUMODIFICACION = '" & MAIL & "', TlbHoras.HOFECHMODIFICACION = '" & Now() & "' " & _
"WHERE TlbHoras.HOAÑO =" & Me.Cboaño & " AND TlbHoras.HOSEMANA=" & Me.CboSemana & " AND TlbHoras.HOPERSONA ='" & MAIL & "';"
DB.Execute SQL
End If
GUARDADO = True
DB.Close
Set DB = Nothing
modulo para opendb:
DB.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:pruebasvariasNueva carpetadb13.mdb;Persist Security Info=False")