Snowflake68
Registered User.
- Local time
- Today, 23:07
- Joined
- May 28, 2014
- Messages
- 452
Ive spent far too long trying to work out why this code doesnt work. This should be so easy and its not even Friday.
I want to programmatically create the RGB for the header backcolour on a form by looking up the values in a table based upon the status
The table is called 'tbl_Status and contains the status as well as the RGB value such as RGB (0, 255, 255)
I have tried to do it several ways by just having the numeric values in the table without the RGB() and trying to create the string but just cant get it to work.
I get runtime error 13 type mismatch when loading the form. The field properties in both the Status and the RGB fields are both text so I am not sure why it is a type mismatch.
I want to programmatically create the RGB for the header backcolour on a form by looking up the values in a table based upon the status
The table is called 'tbl_Status and contains the status as well as the RGB value such as RGB (0, 255, 255)
I have tried to do it several ways by just having the numeric values in the table without the RGB() and trying to create the string but just cant get it to work.
I get runtime error 13 type mismatch when loading the form. The field properties in both the Status and the RGB fields are both text so I am not sure why it is a type mismatch.
Code:
Dim strStatusRGB As String
strStatusRGB = DLookup("RGB", "tbl_Status", "Status = txtStatus")
Me.FormHeader.BackColor = strStatusRGB