This is a Color Chart I put together.
This is a Color Chart I put together.
Thank you for the submittal. However, I think the table is a bit messed up. Some field names don't seem appropriate to their content. The textbox color is not changing to match the specified color name. After adjusting field names, changed code to:
Me.ColorPic.BackColor = RGB(Me!R, Me!G, Me!B)
Also, query is not needed. Bind form directly to table.
A report could show the colors in a continuous table and could be printed.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Your welcome, I guess! I did not notice that.Just finished the thing, thought it was working. Your code gave me a error
Run Time error 13 Type Mismatch.
Thanks,
I deleted the Hex field which had color names, renamed the other fields appropriatelly as Hex, R, G, B (Access code data is missing) and revised code works for me. The R, G, B data works but really should be number, not text, fields. A report would have to be opened in PrintPreview or direct to printer for code to execute:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.ColorPic.BackColor = RGB(Me!R, Me!G, Me!B)
End Sub
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Guess I did not do something right. Mine does not work.
The textboxes on the form show data in wrong fields. Did you fix the field names in table? Should have renamed as follows:
Hex - delete
R to Hex
G to R
B to G
Access to B
add new field if you want - Access
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thanks, it is working. Leave it to me to try and help and not get it right.
You can edit the original post to replace the attachment and add a comment about that.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Sorry for the bad design, it was well intended. Anyway, implement June's code and all is well. Now, to try and get this into a Report. FYI, adding the form to the report does not work.
Here's a colour tool that can help translating between ColorCode, RGB and Hex!~)
Thanks, Pretty Cool.