Changing Background Color Based on Record Data in a Continuous Form

E

Eduardo Leaderez

I have a filled Rectangle Named "Item_Color" on a continuous form.

I have a dropbox Named "Description" that sits on top of that rectangle.

The dropbox is tied to a query.

The 4th column of the Query contains the value of the color I would like to use as the background color for the Rectangle called "Item_Color"

Here is what I have tried for the code for this.

Me.Item_Color.BackColor = Me.Description.Column(3)

I would like to have the color value set by the "On-Current" event for the continuous section of the form AND to the On-Exit event for the dropbox.

But it does not work.

Any suggestions?

Consultant Services
Engineering
Land Acquisition / Consent
Archaeological Services
Environmental Studies
Survey Work
Construction QC
Start-up testing Services
Soil Borings
 
D

Damon Heron

This works for me.

Private Sub Form_Current()
Dim X As Variant
If Not IsNull(Me!Combo0.Column(3)) Then
X = Me!Combo0.Column(3)
Box2.BackColor = X
End If
End Sub

What problem are you having?

Damon

I have a filled Rectangle Named "Item_Color" on a continuous form.

I have a dropbox Named "Description" that sits on top of that rectangle.

The dropbox is tied to a query.

The 4th column of the Query contains the value of the color I would like to use as the background color for the Rectangle called "Item_Color"

Here is what I have tried for the code for this.

Me.Item_Color.BackColor = Me.Description.Column(3)

I would like to have the color value set by the "On-Current" event for the continuous section of the form AND to the On-Exit event for the dropbox.

But it does not work.

Any suggestions?

Consultant Services
Engineering
Land Acquisition / Consent
Archaeological Services
Environmental Studies
Survey Work
Construction QC
Start-up testing Services
Soil Borings
 

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