Hello,
I have a a form called frmMissyFact, I have copied this form and
called it frmMissyFactBackup which reads data from a backup database
of the week before. I brought frmMissyFactBackup into frmMissyFact as
a subform. What I am trying to do is compare each control value from
frmMissyFact to that of frmMissyFactBackup and if the controlvalue is
different change the backcolor to Yellow of the control so the user
looking at it knows that this field has been changed from last week.
I was able to do this with the following code.
Private Sub Form_Current()
Dim lngYellow As Long
lngYellow = RGB(255, 255, 0)
If Me.STR_PROJECTED_VOLUME.Value <>
Me.frmMissyFactbackup.Form.STR_PROJECTED_VOLUME.Va lue Then
Me!STR_PROJECTED_VOLUME.BackColor = lngYellow
Else
End If
If Me.STR_OPEN_DATE.Value <>
Me.frmMissyFactbackup.Form.STR_OPEN_DATE.Value Then
Me!STR_OPEN_DATE.BackColor = lngYellow
Else
End If
End Sub
I would have to do this with every control I have on the form.
The primary key and linked field is Str_Num for the data in both forms
The main problem I have is if when the current database has a new
record (Store Number) and the backup does not. I get an error because
of the code does not see a value in the subform.
Does anybody know how to fix this?
Thanks,