CommonDlg Choose color

  • Thread starter Thread starter 123
  • Start date Start date
1

123

Thank you:
I'm using choose color dialog to change the color of detail area or any
control:
my problem is why this color not save (when close and reopen my form
the color back to first one) how can save the color for my control
note: the form will be in run time and the user (can't change the form from
run time to design time)
any help
thank you

-------start of the code-----------
Dim cdl As CommonDlg
Set cdl = New CommonDlg
cdl.ShowColor
Detail.BackColor = cdl.Color
lblColor.BackColor = cdl.Color
-----------------------end of the code
 
The color assigned at runtime will not be saved.

You will need to save the color to a table, and then use the Form_Open event
to DLookup() the color value and assign it to Me.Detail.BackColor again.
 
Thank you for your help:

Can you give us some points to do that? or give us the line becuse it is not
easy work..
thank you..
 
Allen Browne said:
The color assigned at runtime will not be saved.

You will need to save the color to a table, and then use the Form_Open event
to DLookup() the color value and assign it to Me.Detail.BackColor again.

If this is a Multi-User environment, the Table must also distinguish the settings by username or the
value will be passed to the form when opened by any user.
 
You could use a table and code similar to this link:
http://allenbrowne.com/ser-18.html

That code shows how to return the the same record next time a form is
opened, but you could do something similar for storing and restoring the
BackColor of the Detail section.
 
Allen Browne....

Thank you for your help
Ok
How can I store the color that applied form Commondlg to table?
Thank
Hop you can help...or Idea
 
123, you may need to learn a little about tables, recordsets, and VBA to
achieve what you want to do. The example should help you.
 
Back
Top