ASI ES COMO GUARDAMOS TODOS LOS VALORES DEL FORMULARIO, ES PARTE DEL FORM4:
If (Form1.codig = "") Then
Else
enc = False
Set rs = cnn.Execute("SELECT DISTINCT CÓDIGO FROM t_codigo")
rs.MoveFirst
While Not rs.EOF And enc = False
If (rs.Fields(0) = Form1.codig) Then
enc = True
End If
rs.MoveNext
Wend
If (enc = False) Then
cnn.Execute "INSERT INTO t_codigo Values ('" & Form1.codig & "')"
End If
End If
cnn.Execute "INSERT INTO UNIDAD_DOCUMENTAL Values ('" & IIf(IsNull(Form1.TxtFoto) Or Form1.TxtFoto = "", " ", Form1.TxtFoto) & "', '" & IIf(IsNull(Form1.TxtSignatura) Or Form1.TxtSignatura = "", " ", Form1.TxtSignatura) & "', '" & IIf(IsNull(Form1.TxtCodigo) Or Form1.TxtCodigo = "", " ", Form1.TxtCodigo) & "','" & IIf(IsNull(Form1.cod.Text) Or Form1.cod.Text = "", " ", Form1.cod.Text) & "')"
Form1.Show
Form4.Hide
AKI ES DONDE DEBERIA VERSE LOS NUEVOS REGISTROS, PERO SOLO APARECEN LOS VIEJOS. ESTO ES PARTE DEL FORM1:
Private Sub form_load()
Dim SQL1 As String
'sPath = App.Path + "PROYECTO ARCHIVO GRÁFICO FUNDACIÓN AMALUR.mdb"
'sPath = sPath
' Por si ya estaba abierta...
Set cnn = Nothing
Set rs = Nothing
' Crear los objetos
Set cnn = New ADODB.Connection 'declaración de la conexion
Set rs = New ADODB.Recordset 'creación del recordset
' para saber que b.d abrir tenemos el ConnectionString
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & sPath & ";" & _
"Mode=ReadWrite|Share Deny None;" & _
"Persist Security Info=False;Jet OLEDB"
cnn.Open sPath 'abrir la bd
Set rs = cnn.Execute("SELECT DISTINCT CÓDIGO FROM t_codigo ")
rs.MoveFirst
While Not rs.EOF
cod.AddItem rs.Fields(0)
rs.MoveNext
Wend
MUCHAS GRACIAS