Hello everyone!
I created this little function to generate random hex colors:
I used it in my query intending to generate a random color string for each record, but my query returns the same color string for all records. How can I make it so that it returns a different color for each record?
I created this little function to generate random hex colors:
Code:
Public Function rndColorHex() As String
Dim r
Dim g
Dim b
Randomize
r = Hex(Int(255 * Rnd) + 1)
Randomize
g = Hex(Int(255 * Rnd) + 1)
Randomize
b = Hex(Int(255 * Rnd) + 1)
rndColorHex = "#" & r & g & b
End Function
I used it in my query intending to generate a random color string for each record, but my query returns the same color string for all records. How can I make it so that it returns a different color for each record?