[Access 2007] Account Status not being read when record changes
Firstly i am using Access 2007
I have a customer DB when in a customer record i have a combo called cboAccountStatus this has Stop, Open, Closed and Legal, lets assume that customer ABCD is on stop, when i change it to stop it changes their company name to Red, when i change it back to Open it changes back to the normal black font. This all works ok.
I have a cboCompanyLookup which when i click gives me a list of customers, i select and the form is updated with that selected record. That also is ok,
the problem i am having is after the form is updated with the selected customer the cboAccountStatus changes according to the customer however it still shows the text as Red from the previous customer.
i have tried the afterupdate, and on change but still nothing;
This is what i have for the cboAccountStatus
Code:
Private Sub cboAccountStatus_AfterUpdate()
If AccountStatus.Text = "Stop" Then
Auto_Title0.ForeColor = vbRed
AccountNo.BackColor = vbRed
AccountNo.ForeColor = vbWhite
Company.BackColor = vbRed
Company.ForeColor = vbWhite
AccountStatus.BackColor = vbRed
AccountStatus.ForeColor = vbWhite
Else
If AccountStatus.Text = "Open" Then
Auto_Title0.ForeColor = -2147483615
AccountNo.BackColor = vbWhite
AccountNo.ForeColor = vbBlack
Company.BackColor = vbWhite
Company.ForeColor = vbBlack
AccountStatus.BackColor = vbWhite
AccountStatus.ForeColor = vbBlack
End If
End If
End Sub
i tried this in the cboCompanyLookup after update but it doesnt change the colored text
your helpis appreciated.
T