Hi, I have one color scheme I want to use all through the database I am developing. The next examples have just one color defined, to make it simpler (a dark blue, that I would call B1)
If I define the color inside the sub, it's ok (see below).
... however this means I have to repeat the color definition every sub, so I thought would be neater to define a function to set my color codes (I have 20 colors).
My objective, is when I'm working in forms, Iwould (ideally) call this function "setcolor" and just write my code for the blue. I tried the examples below:
or
...but doesn't work.
Again, this is probably some definition of arguments or dimensions that I am not aware of. Does any one have an idea how to predefine the colors in a function to give them a "short" code which I can call in any sub in the database?
If I define the color inside the sub, it's ok (see below).
Code:
private sub setlabel()
Dim B1
B1 = RGB (0,52,105)
me.label1.forecolor = B1
end sub
Code:
Function SetColor()
Dim B1
B1 = RGB (0,52,105)
End function
Code:
Private sub setlabel()
SetColor()
me.label1.forecolor = B1
end sub
Code:
private sub setlabel()
SetColor(B1)
me.label1.forecolor = B1
end sub
Again, this is probably some definition of arguments or dimensions that I am not aware of. Does any one have an idea how to predefine the colors in a function to give them a "short" code which I can call in any sub in the database?