Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can someone please help me with the

Status
Not open for further replies.

DDTiff

MIS
May 29, 2002
48
US
Can someone please help me with the following question. I thank you for your help and time in advance.

I have a subform inside a form that displays as Datasheet view. My goal is to highlight the cell when a change occurs.

For example, the Datasheet consists of 4 columns: TaskID, TaskName, CustomerName and Budget($). When the user changes the TaskName of TaskID #102, I would like to see the Backcolor of the TaskName TaskID#102 change color to signify that there was a change(color configuration). The user than moves to TaskID#300 and changes the Budget value from $100 to $200, then I would like to see the Budget cell to change color as well.

I have tried the conditional formatting that comes with MS Access and it did not work. Is there a way I can accomplish this procedure using VBA. Again, thank you for your help.
 
Are you trying to set a given color for when a change takes place or to display a given color dependant on the information entered?

John Green
 
Hi John,

Thank you for your reply. Sorry for not having a chance to get back with you until now. My intent is to get the cell to change color when there a change taken place. I've tried the color configuration from the VBA book, but I could only make the whole column changes color when there is a change taken place, instead of only the specific revelent cell.

I appreciate your time and effort. Hope to hear from you soon.

V/r,

Diem
 
Just off the top of my head, change the subform to be a form rather thana datasheet and then make the form cosmetically look like a datasheet (I've done this before). You can now put events on the form such as changing the back colour upon a value change.

I think it's possible.
 
How do you cosmetically make the form looks like the datasheet? There are two other options besides Design View and they are Form and Datasheet. If I chose form then, the form would have Labels and Textboxes, but if I chose Datasheet than I would see the datasheet view.

I have tried with a brand new form, but it still did not work like you said.

I've tried using the AfterUpdate event for the Budget textbox, but the color configuration affect the whole column instead of specific cell.

How would you use color configuration to make the color changes when there is a change occur? I still did not figure that out yet. Can you please help me? I think it has something to do with oldvalue and current value, right? I look forward to hear from you soon.

Thank you for your time and effort.

Diem
 
What version of Access are you using? What you need to do is create the form using continuous forms, put all the entries on one line with the headings in the Form Header. You can then arrange your text boxes or other controls like a datasheet. The conditional formatting wasn't available in Access 97, I'm not sure about 2000, I just know its in 2002.


John Green
 
Create your subform as a Single Form. Then on the textboxes of the controls, on the AfterUpdate event place
Me![controlname].BackColor = (a color number you can get from playing with the Backcolor property)

Neil
 
Neil,

I've tried the same code, but it ended up changing the color of the whole field instead of a specific cell in the form. For example, if I change the budget value of task #102 from white to blue when a change occur, then all the budget field of all tasks will turn to blue instead just task #102.

V/r,


Diem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top