SubForm questions

J

Jeff

Hi

I have a Sub-Form in Continuous Forms View. In there is a Text Box with an Input Mask to enter a Date

I then have in the Private Sub Form_Error(DataErr As Integer, Response As Integer) logic to trap the error if the format of the data is entered in wrong will display a message

But what I would like to do also is change the BackGround Color to Red.
If I put code to change it (Me.Controls(Screen.ActiveControl.Name).BackColor = 255) Every Row gets changed. Which I dont want. I just want to current row only to change. I then tried with Conditional Fomatting, but that doesn't work as it doesnt get triggered until after the Form_Err runs, hence it does not change the back gournd color

I have no idea how to accomplish this; again to change the Backgournd Color of only the Current Row that has an Invalid Date, in which it uses Form_Err to check if its an invalid Date

Can anyone help me, ideally if they can write the code on how to do this

Thank you very much
Jef
 
C

CanoeTrail

Jeff

I would try to use 'Conditional Formatting' to change the
color of a field when that field contains specific
information. I did this just yesterday: when the field
contains "Warning" the background changes to red.

-----Original Message-----
Hi,

I have a Sub-Form in Continuous Forms View. In there is
a Text Box with an Input Mask to enter a Date.
I then have in the Private Sub Form_Error(DataErr As
Integer, Response As Integer) logic to trap the error if
the format of the data is entered in wrong will display a
message.
But what I would like to do also is change the BackGround Color to Red.
If I put code to change it (Me.Controls
(Screen.ActiveControl.Name).BackColor = 255) Every Row
gets changed. Which I dont want. I just want to current
row only to change. I then tried with Conditional
Fomatting, but that doesn't work as it doesnt get
triggered until after the Form_Err runs, hence it does not
change the back gournd color.
I have no idea how to accomplish this; again to change
the Backgournd Color of only the Current Row that has an
Invalid Date, in which it uses Form_Err to check if its an
invalid Date.
 

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