I have 2 tables (that admittedly go somewhat against the normalisation rules) called tbl_customer and tbl_customer_changed.
tbl_customer holds details of all our customers, tbl_customer_changed holds temporary information on address changes that gets deleted once it has beeen approved. This allows the great unwashed in the organisation to make changes without messing anything up and it works very well.
However I am trying to highlight on a form, by changing the textbox's background colour, where the record displayed (from tbl_customer_changed) differs from the record held in tbl_customer so that the person approving the changes can see them at a glance.
I am using this code:
matchorg = Forms![frm_customer_changed]![OrganisationID]
Set db = CurrentDb()
Set rec = db.OpenRecordset("SELECT * FROM tbl_customer WHERE ((tbl_customer.OrganisationID)= " & matchorg & "
;"
If Me!txtOrganisation <> rec("Organisation"
Then Me!txtOrganisation.BackColor = 10088675
This works ok for most fields except it won't highlight any fields where the record in tbl_customer is Null and has been changed in tbl_customer_changed.
I have tried adding this line:
If (IsNull(Me!txtemail) = False And IsNull(rec("E-Mail Address"
) = True) Then Me!txtemail.BackColor = 10088675
But it still doesn't work.
Can anyone suggest anything?
tbl_customer holds details of all our customers, tbl_customer_changed holds temporary information on address changes that gets deleted once it has beeen approved. This allows the great unwashed in the organisation to make changes without messing anything up and it works very well.
However I am trying to highlight on a form, by changing the textbox's background colour, where the record displayed (from tbl_customer_changed) differs from the record held in tbl_customer so that the person approving the changes can see them at a glance.
I am using this code:
matchorg = Forms![frm_customer_changed]![OrganisationID]
Set db = CurrentDb()
Set rec = db.OpenRecordset("SELECT * FROM tbl_customer WHERE ((tbl_customer.OrganisationID)= " & matchorg & "
If Me!txtOrganisation <> rec("Organisation"
This works ok for most fields except it won't highlight any fields where the record in tbl_customer is Null and has been changed in tbl_customer_changed.
I have tried adding this line:
If (IsNull(Me!txtemail) = False And IsNull(rec("E-Mail Address"
But it still doesn't work.
Can anyone suggest anything?