Marshall Brooks
Member
- Local time
- Today, 13:01
- Joined
- Feb 28, 2023
- Messages
- 696
At first I thought this was a crazy question, but perhaps not ...
I would like to call this color picker from a button on my form:
That is from Excel, but I noticed the same color picker is available in Access if I open a form in design view and change the fore color of a text box, for example. So the dialog is available in Access, I just don't know how to call it. In Excel - https://exceloffthegrid.com/calling-and-using-the-color-picker-with-vba/ - it would be Application.Dialogs(Application.Dialogs(xlDialogEditColor).Show 1, 26, 82, 48) - but there doesn't seem to be any Application.Dialogs() available in Access.
I have my code working with the standard windows Color picker, but I want to change it to use this one. The code I am using was modified from https://www.devhut.net/vba-choosecolor-api-x32-x64/, looks like this, and does the following, which I would want the new code to do also:
When I click the circled color palette command button, it:
I would like to call this color picker from a button on my form:
That is from Excel, but I noticed the same color picker is available in Access if I open a form in design view and change the fore color of a text box, for example. So the dialog is available in Access, I just don't know how to call it. In Excel - https://exceloffthegrid.com/calling-and-using-the-color-picker-with-vba/ - it would be Application.Dialogs(Application.Dialogs(xlDialogEditColor).Show 1, 26, 82, 48) - but there doesn't seem to be any Application.Dialogs() available in Access.
I have my code working with the standard windows Color picker, but I want to change it to use this one. The code I am using was modified from https://www.devhut.net/vba-choosecolor-api-x32-x64/, looks like this, and does the following, which I would want the new code to do also:
When I click the circled color palette command button, it:
- Reads the string value from the text box below it.
- Parses the string into R,G,B elements.
- Converts that to Long color (OLE Color).
- Opens the color picker with that color selected.
- Returns the newly selected color as OLE. (If the user clicks cancel, it returns the original calling color).
- Converts that back to RGB.
- Writes the new value to the text box below the button.