Colours

ddrew

seasoned user
Local time
Today, 23:23
Joined
Jan 26, 2003
Messages
911
Is it possible to create a combo box showing colours. I don't mean the wors Blue, Red etc I mean a list of actual colours?
 
The colors range from -2147483648 to 2147483647 for the VB forms. To display this i would suggest making a continuous form with the wizard that displays all the records from a table you create that has the numbers -2147483648 to 2147483647 (automation reccomended for populating list :P). Then in design mode just place a textbox beside the field displaying that number. In the VB code on cboafterupdate set txtBox.BackColor property = to Me.ColorID (colorID is the name of the field in your table)
 
Last edited:
Hi, thanks for the reply. I'm not sure I understand though, any chance of a demo?
 
I have rethough what i Said before a bit when actually applying it. Here is asimple demo of what i think you want
 

Attachments

This is kind of what I'm after Rural Guy, my problem is that I dont want the box to change on all records, just the one I'm working on. Every record needs to be able to change individualy. Any ideas. Ive tried conditional formating but you cant do enough of them to cover the windows colour palette.
 
So far you have not described what you have and what you are trying to accomplish. If it is a continuous form and you are trying to get a different color on each record then you will probably not succeed. If it helps, for a control to act uniquely in a continuous form it needs to be bound to a field in the underlying table. If you describe the "box" on each record maybe someone here can better assist in a solution.
 
OK, its simple really I have a text box, that when clicked brings up the windows colour pallette. I can then change the colour of the box to suitMy problem is that if I change the colour on one record it changes the box on all records. I want to be able to change the colour on one record only. The next record may need to be different. The colours need to be changed as they are used as a reference in another application. Hopefully that explains it.
 
Saving the value of the color in a field underlying the continuous form will not be a problem but as I indicated earlier, displaying a record in a continuous form in *that* color is beyond the scope of a Continuous form. Sorry. Conditional formatting is the only method I know that can effect this change and it is currently limited to 3 choices.
 
Sorry, I should have said it isn't a continuous form!
 
You still need a field in the table to store the color value. Do you have one?
 
If you have a field with a color code then in the Current event of the form you could put something like:
Me.txtBox2.BackColor = [ColorCode]
change txtBox2 to your textbox name
change [ColorCode] to your field with the ColorCode
 
Do you mean as in the example that you posted. If so I understand but that but it changes the box colour in every record and Im trying to avoid that!
 
How about:
If Len([ColorCode] & "") > 0 Then
Me.txtBox2.BackColor = [ColorCode]
Else
Me.txtBox2.BackColor = 16777215 '-- White
End If
 
PK can't seem to get this to work as I want. Is it posible to store bitmaps in a como box? I figure if I can then I can create bitmaps of the colours and then select them from a combobox
 
Im gonna play with this again tomorrow, in the meantime thanks.
 
You're welcome. Just for the record, there is only one set of properties for each form. I get the feeling you would like there to be a set of properties for each record. In Single Form mode you can manipulate those properties for each record in the Current event. Yes you can store a Bit Map in a field in an Access db but Access is lousy at storing graphics and bloates up the db way beyond proportion. It would be better to find a different method to achieve your desire. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom