Good Morning All (Though its afternoon here!)
I hope this is in the correct section - apologies if not! Further apologies for the length of this post - I'd like to fully explain my situation so potential helpers have all the details.
A friend has a small beading/jewellery business and she has asked if I could make her a database to keep track of her stock. I rashly said "Yes, no problem" without really considering what she was asking for!
The vast majority of the database will be very simple and I think I can probably manage it but there is a bit that has me stumped.
Naturally she will want to catalog her beads, and whilst many of the variables will have only a few different values, colour is stored as an RGB value with over 16 million possibilities - thats a big combo box!
What I wanted to achieve was for her to be able to enter the colour via a picker so she can match the colour of the bead by eye as opposed to giving it a text string like "Dark Yellowy Orange" etc or by entering the exact RGB values. That part I have so far managed. The function I am using changes the BackColor property of the text box to the selected colour and also writes the RGB values in the box as a value.
The bit I really need help with is in searching for records. What I want to be able to do is to have a switchboard command that opens the same function so she can use the colour picker to choose an approximate colour (and its RGB values) for the beads she wants to find. The query/macro would then return all matching records (based on other parameter queries as well).
But for her to select the EXACT same colour as she entered when storing the data originally is going to be nigh on impossible (1 in 16 million) so is there a way for the query/macro to allow a 'lee-way' on the RGB values and return all matching records for the RANGE of RGB values, say +/- 20?
Am I babbling? Ill try and explain!
Original record stored (visually with colour picker) with RGB values of 100,100,100.
When the query/macro is run, the colour picker appears and she selects (again, visually, without entering RGB values)a purpley colour: 97,87,102.
She doesnt have any beads that match this precise colour, but with a code that allows values between 77-117, 67-107, 82-122 her above record is returned as a close match.
Is this possible?
Many thanks for simply reading this behemoth - many more thanks in advance for any help!
-----EDIT-----
Ok, the original code seems to not be that great for this purpose! First of all, instead of storing as RGB values, the value returned is the literal colour value (ie between 0 and 16.5millionish) and so instead of offering -/+ 20 on RGB values, I would need to offer -/+1000000 on the literal value.
Also, when scrolling through stored records on the form, although the actual colour value (number out of 16million) changes, the background colour stays the same as the last record entered for each record. I need to get the code to reference the number in the text box, convert it into a colour again and then set the background to that colour.