setting back color with setproperty macro

M

mbaycura

How can I set the background color of an object using the SetProperty Macro?
So far I've been able to get enable and visible to work with that macro by
using "0" or "1" for the value, but I don't know what the acceptable values
for Back Color are. I've tried hexadecimal, but that doesn't seem to work.

I'm guessing I just don't know the right values to enter because originally
I was trying to get visible and enable to work, I tried using the same values
selectable in the properties sheet, "Yes" or "No", but that didn't work
either.
 
S

Storrboy

mbaycura said:
How can I set the background color of an object using the SetProperty Macro?
So far I've been able to get enable and visible to work with that macro by
using "0" or "1" for the value, but I don't know what the acceptable values
for Back Color are. I've tried hexadecimal, but that doesn't seem to work.

I'm guessing I just don't know the right values to enter because originally
I was trying to get visible and enable to work, I tried using the same values
selectable in the properties sheet, "Yes" or "No", but that didn't work
either.

If you look up the different properties in the help files, it should tell
you what value type you need to use. I believe colours in Access are
expected to be Long numbers. In the Expression box either enter a long
number or you should be able to use the RGB function to build the number for
you...

Example using as the expression:
-2147483643 'sets to system colour for active window space
Or
RGB(255,255,255) 'sets to white.
 
M

mbaycura

I had tried the help files, but they don't describe the syntax to use in the
macro builder, but I figured out the problem after seeing your RGB syntax. I
needed to use the syntax "=RGB(xxx,xxx,xxx)" to get it to work. Long
integers worked too, but they were always way off in color, like pink instead
of black. The long integer conversions I did from hex form (#FFFFFF) to
decimal were correct, but the scale in access must be based on something
different.

anyway, I got it to work, thanks for the assistance.
 
S

Storrboy

mbaycura said:
I had tried the help files, but they don't describe the syntax to use in the
macro builder, but I figured out the problem after seeing your RGB syntax. I
needed to use the syntax "=RGB(xxx,xxx,xxx)" to get it to work. Long
integers worked too, but they were always way off in color, like pink instead
of black. The long integer conversions I did from hex form (#FFFFFF) to
decimal were correct, but the scale in access must be based on something
different.

anyway, I got it to work, thanks for the assistance.



It's not the syntax I was talking about. Usually as part of the first few
lines of the description of the property or method, there will be a
statement like "...sets or returns a value (Long)...." or "...Read/write
Long..." This indicates the property expects a Long integer. I'm a little
surprised you had to use the = sign in the expression box. The blurb to the
right of the Action Arguments of the macro window states not to use it, and
it worked for me without it. Oh well, as long as it works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top