Todo son formularios
este entro los datos
aquí las entregas
aquí el resultado de T.A pagar - Total Entregas
y esta es la etiqueta donde dice si esta pagado, pendiente, etc.
en las entregas al perder enfoque esto
Private Sub Importe_LostFocus()
Me.Requery
Me.Parent.TotalEntregas = Me.SumaEntregas
Me.Parent.Pendiente = Me.Parent.TotalAPagar - Me.Parent.TotalEntregas
Me.Parent.Refresh
MsgBox "El Importe Pendiente es de : " & (Nz(Me.Parent.Pendiente))
Me.Parent.TotalEntregas.SetFocus
Call Me.Parent.ColorSegunValor
End Sub
i al recibir enfoque en el Total Entregas esto
Private Sub TotalEntregas_GotFocus()
Call ColorSegunValor
End Sub
Me.TotalAPagar = Me.TotalPrincipal + Me.RecargoDeApremio + Me.InteresesDeDemora + Me.CostasDeProcedimiento
If Me.Pendiente = 0 Then
Me.EtiPagado.Caption = "IMPORTE PAGADO"
Me.EtiPagado.BackColor = 52582 'verde
Me.FacturaPagadaSiNo = True
Me.EtiPagos.Caption = "(Total Entregas) es igual a (Total A Pagar)"
Me.EtiPagos.BackColor = 52582 'verde
Me.EtiPagos.ForeColor = 0 'negro
Me.Etiqueta90.BackColor = 52582 'verde
Me.Etiqueta91.BackColor = 52582 'verde
End If
If Me.TotalEntregas < Me.TotalAPagar Then
Me.EtiPagado.Caption = "IMPORTE PENDIENTE DE PAGAR"
Me.EtiPagado.BackColor = 255 'rojo
Me.FacturaPagadaSiNo = False
Me.EtiPagos.Caption = "(Total Entregas) es menor a (Total A Pagar)"
Me.EtiPagos.BackColor = 255 'rojo
Me.EtiPagos.ForeColor = 0 'negro
Me.Etiqueta90.BackColor = 255 'rojo
Me.Etiqueta91.BackColor = 255 'rojo
End If
If Me.TotalEntregas > Me.TotalAPagar Then
Me.EtiPagado.Caption = "IMPORTE PAGADO Entregas de más"
Me.EtiPagado.BackColor = 16741960
Me.FacturaPagadaSiNo = False
Me.EtiPagos.Caption = "(Total Entregas) es mayor a (Total A Pagar)"
Me.EtiPagos.BackColor = 16741960
Me.EtiPagos.ForeColor = 0 'negro
Me.Etiqueta90.BackColor = 16741960
Me.Etiqueta91.BackColor = 16741960
End If
If Me.TotalEntregas > Me.TotalAPagar Then
Me.FacturaPagadaSiNo = True
Me.FacturaPendienteSiNo = False
End If
If Me.TotalEntregas < Me.TotalAPagar Then
Me.FacturaPagadaSiNo = False
Me.FacturaPendienteSiNo = True
End If
End Sub
Tengo que decirte que no tengo muchos conocimientos en access.
Saludos.