La solución que te he dado es más sencilla , la que tu pretendes es mucho más laboriosa , complicada y causa de problemas si no se hace bien , pero aún así te voy a indicar como se hace
1.- creas la tabla
2.- creas el formulario : condiciones: --no le pongas origen de registro
ponle los cuadros de texto pero sin origen de datos , porque los datos los vamos a rellenar cuando los leamos
LEER
para leer un registro escribimos en cuado de texto ejemplo TEXTOID el numero buscado
y en el evento despues de actualizar
Rem BUSCA un registro
Set rs = CreateObject("ADODB.RecordSet")
Set CON = Application.CurrentProject.Connection
c10 = "": c20 = "": c30 = "": c40 = "": C50 = "": c60 = " ": c70 = "": c80 = ""
c10 = "SELECT * FROM [T060-PLATOS] "
c20= “ where [CAMPOBUSCADO ] =” & STR$ TEXTOID
consulta = c10 & c20 & c30 & c40 & C50 & c60 & c70 & c80
rs.Open consulta, CON, adOpenDynamic, adLockOptimistic
rs.MoveLast
rs.MoveFirst
rem ahora rellenamos los cuadros de texto del formulario
CUADROtexto1 = RS.Fields("ID-T060").Value
CUADROtexto2 = RS.Fields(2).Value
CUADROtexto3 = RS.Fields(3).Value
…
…
…..
…..
RS.Close
rem condiciones
MODIFICAR --------------
para modificarlo hay que hacerlo al revés , pasar los datos de el formulario a la tabla con la instrucción UPDATE
EL EJEMPLO PONE [NOMBRE DE TABLA].[NOMBTRE DE CAMPO]= CUADRO DE TEXTO DEL FORMULARIO
OJO FIJate como se escriben los datos que son números, los que son cadenas y los que son fechas
REm MODIFICAR ------------------------------------------------------------------------
consulta = " UPDATE [T-VISITAS-CON1] SET "
consulta = consulta & " [T-VISITAS-CON1].[FECHA-CON1] = # " & Format([WFECHA-CON1], "mm/dd/yyyy") & "# , "
consulta = consulta & " [T-VISITAS-CON1].[EXPEDIENTE-CON1] = " & Str$([WEXPEDIENTE-CON1]) & " , "
consulta = consulta & " [T-VISITAS-CON1].[USUARIO-CON1] = '" & [WUSUARIO-CON1] & "', "
consulta = consulta & " [T-VISITAS-CON1].[TRABAJADOR-CON1] = " & Str$([WTRABAJADOR-CON1]) & " , "
consulta = consulta & " [T-VISITAS-CON1].[NOMBRETRA-CON1] ='" & [WNOMBRETRA-CON1] & "', "
' consulta = consulta & " [T-VISITAS-CON1].[VALORACION-GENERAL-CON1] = " & Str$([WVALORACION-GENERAL-CON1]) & " , "
' consulta = consulta & " [T-VISITAS-CON1].[OTROS-DATOS-CON1] = ' " & [WOTROS-DATOS-CON1] & "', "
' consulta = consulta & " [T-VISITAS-CON1].[DETALLE-CON1] = ' " & [WDETALLE-CON1] & "', "
' consulta = consulta & " [T-VISITAS-CON1].[OTROS-CON1-2] = ' " & [WOTROS-CON1-2] & "', "
consulta = consulta & " [T-VISITAS-CON1].[HORAVISITA-CON1] ='" & [WHORAVISITA-CON1] & "', "
' consulta = consulta & " [T-VISITAS-CON1].[VISITAREALI-CON1] =' " & [WVISITAREALI-CON1] & "', "
consulta = consulta & " [T-VISITAS-CON1].[OBSERVACIONES-CON1] = '" & [WOBSERVACIONES-CON1] & "', "
consulta = consulta & " [T-VISITAS-CON1].ORDEN = " & Str$(WORDEN) & " , "
consulta = consulta & " [T-VISITAS-CON1].[INCILLA-CON1] = '" & [WINCILLA-CON1] & "', "
consulta = consulta & " [T-VISITAS-CON1].NVP = " & Str$(WNVP) & " , "
consulta = consulta & " [T-VISITAS-CON1].[CREA/MOD/BOR] ='" & "M" & "', "
consulta = consulta & " [T-VISITAS-CON1].[FECHA-MOD] = #" & Format(Now(), "mm/dd/yyyy") & "# , "
consulta = consulta & " [T-VISITAS-CON1].NUMTORIZADO = " & Str$(NUM) & " , "
consulta = consulta & " [T-VISITAS-CON1].NOMAUTORIZADO ='" & NOM & "' "
consulta = consulta & " WHERE ((([T-VISITAS-CON1].[ID-CON1])= " & Str(Forms![F-PROGRAMAR-VISITAS]![Subformulario T-VISITAS-CON1].Form.[ID-CON1]) & " )) "
Set RS = CreateObject("ADODB.RecordSet")
Set CON = Application.CurrentProject.Connection
RS.Open consulta, CON, adOpenDynamic, adLockOptimistic
Forms![F-PROGRAMAR-VISITAS].Refresh
MsgBox " REGISTRO MODIFICADO "
DoCmd.Close
PARA AÑADIR DATOS . Ponernos en el formulario y luego con la instrucuón INSERT
Rem INSERTAR ------------------------------------------------------------------------------------
consulta = "INSERT INTO [T-VISITAS-CON1] ( "
'consulta = consulta & " [ID-CON1], "
consulta = consulta & " [FECHA-CON1], "
consulta = consulta & "[EXPEDIENTE-CON1], "
consulta = consulta & " [USUARIO-CON1], "
consulta = consulta & " [TRABAJADOR-CON1], "
consulta = consulta & " [NOMBRETRA-CON1], "
' consulta = consulta & "[VALORACION-GENERAL-CON1], "
' consulta = consulta & "[OTROS-DATOS-CON1], "
' consulta = consulta & "[DETALLE-CON1], "
' consulta = consulta & "[OTROS-CON1-2], "
consulta = consulta & "[HORAVISITA-CON1], "
' consulta = consulta & " [VISITAREALI-CON1], "
consulta = consulta & "[OBSERVACIONES-CON1], "
consulta = consulta & "ORDEN, "
consulta = consulta & " [INCILLA-CON1], "
consulta = consulta & "NVP, "
consulta = consulta & "[CREA/MOD/BOR], "
consulta = consulta & "[FECHA-MOD], "
consulta = consulta & "NUMTORIZADO, "
consulta = consulta & "NOMAUTORIZADO ) "
consulta = consulta & "SELECT "
' consulta = consulta & " " & Str$(ultimor) & " AS Expr0, "
consulta = consulta & " #" & Format([WFECHA-CON1], "mm/dd/yyyy") & "# AS Expr1, "
consulta = consulta & " " & [WEXPEDIENTE-CON1] & " AS Expr2, "
consulta = consulta & " '" & [WUSUARIO-CON1] & "' AS Expr3, "
consulta = consulta & " " & [WTRABAJADOR-CON1] & " AS Expr4, "
consulta = consulta & " '" & [WNOMBRETRA-CON1] & "' AS Expr5, "
' consulta = consulta & " " & [WVALORACION-GENERAL-CON1] & " AS Expr6, "
' consulta = consulta & " " & [WOTROS-DATOS-CON1] & " AS Expr7, "
' consulta = consulta & " " & [WDETALLE-CON1] & " AS Expr8, "
' consulta = consulta & " " & [WOTROS-CON1-2] & " AS Expr9, "
consulta = consulta & " '" & [WHORAVISITA-CON1] & "' AS Expr10, "
' consulta = consulta & " " & [WVISITAREALI-CON1] & " AS Expr11, "
consulta = consulta & " '" & [WOBSERVACIONES-CON1] & "' AS Expr12, "
consulta = consulta & " " & Str$(WORDEN) & " AS Expr13, "
consulta = consulta & " '" & [WINCILLA-CON1] & "' AS Expr14, "
consulta = consulta & " " & WNVP & " AS Expr15, "
consulta = consulta & " '" & [WCREA/MOD/BOR] & "' AS Expr16, "
consulta = consulta & " #" & Format$([WFECHA-MOD], "mm/dd/yyyy") & "# AS Expr17, "
consulta = consulta & " " & WNUMTORIZADO & " AS Expr18, "
consulta = consulta & " '" & WNOMAUTORIZADO & "' AS Expr19 "
' consulta = consulta & " FROM [T-VISITAS-CON1] "
Set RS = CreateObject("ADODB.RecordSet")
Set CON = Application.CurrentProject.Connection
' MsgBox consulta
RS.Open consulta, CON, adOpenDynamic, adLockOptimistic
Limpiar datos
Además de ésto tendrás que lim piar los datos de la pantalla y esto tendrás que hacerlo con una llamada a una funcion como por ejemplo :
Private Sub LIMPIA_PANTALLA()
Rem LIMPIA LA PANTALLA
[WID-CON1].Value = ""
[WFECHA-CON1] = ""
[WEXPEDIENTE-CON1] = ""
[WUSUARIO-CON1] = ""
[WTRABAJADOR-CON1] = ""
[WNOMBRETRA-CON1] = ""
'[WVALORACION-GENERAL-CON1] = "0"
'[WOTROS-DATOS-CON1] = " "
[WDETALLE-CON1] = ""
[WOTROS-CON1-2] = ""
[WHORAVISITA-CON1] = ""
[WVISITAREALI-CON1] = ""
[WOBSERVACIONES-CON1] = ""
[WORDEN] = ""
[WINCILLA-CON1] = ""
[WNVP] = "1"
[WCREA/MOD/BOR] = "M"
[WFECHA-MOD] = Now()
[WNUMTORIZADO] = NUM
[WNOMAUTORIZADO] = NOM
End Sub