AfterUpdate

J

James Frater

Hello Chaps,

In the AfterUpdate code I had the detail back colour change if a check box
(tbc) = True. However if I tick the box now it turns the back colour of every
form irrespective if that record is ticked tbc or not!

Any help on solving this would be great.

JAMES


Private Sub tbc_afterupdate()

If Me.tbc = True Then
Me.Section(0).BackColor = 65535
Else
Me.Section(0).BackColor = 16777215
End If
End Sub
 
A

Arvin Meyer [MVP]

If you are using a continuous form, that code won't work. The good news is
that you can use Conditional Formatting to make it work. In Design View,
select the combo box and from the menu, choose Format >>> Conditional
Formatting, then set your conditions.
 
J

James Frater

Arvin,

I'm using a good old fashioned single form, and apologies for not making it
clearer it's a yes/no box rather than a combo box that I'm using, so
conditional formatting doesn't work.

I've tried setting the reverse conditions in the beforeupdate event but
still can't it to work.

Any futher suggestions would be most welcome.

Regards

JAMES
 
J

J_Goddard via AccessMonster.com

Hi -

The True/Dalse check for tbc_ is only done if you make a change to the tbc_
checkbox by clicking on it.

Try putting your code in the On current event of the form as well, so that it
runs each time you move to a new record.

John

James said:
Arvin,

I'm using a good old fashioned single form, and apologies for not making it
clearer it's a yes/no box rather than a combo box that I'm using, so
conditional formatting doesn't work.

I've tried setting the reverse conditions in the beforeupdate event but
still can't it to work.

Any futher suggestions would be most welcome.

Regards

JAMES
If you are using a continuous form, that code won't work. The good news is
that you can use Conditional Formatting to make it work. In Design View,
[quoted text clipped - 19 lines]
 
J

James Frater

John,

It works!

Thanks for this most appreciated.

Regards

JAMES

J_Goddard via AccessMonster.com said:
Hi -

The True/Dalse check for tbc_ is only done if you make a change to the tbc_
checkbox by clicking on it.

Try putting your code in the On current event of the form as well, so that it
runs each time you move to a new record.

John

James said:
Arvin,

I'm using a good old fashioned single form, and apologies for not making it
clearer it's a yes/no box rather than a combo box that I'm using, so
conditional formatting doesn't work.

I've tried setting the reverse conditions in the beforeupdate event but
still can't it to work.

Any futher suggestions would be most welcome.

Regards

JAMES
If you are using a continuous form, that code won't work. The good news is
that you can use Conditional Formatting to make it work. In Design View,
[quoted text clipped - 19 lines]
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top