Hey I am working on a project using access and vb The basic
Hey, I am working on a project using access and vb. The basic of what I\'m trying to do is first form (login) Second form choose a color like blue, green brown, red, yellow etc......(I already did the first two but this is where I am stuck) Now say if I pick Blue and click \"Select\". I want a third form to display with all the secondary colors. I\'m using access to store my information and vb and a datagridview to display my information for the user. Any help that you can give I would really appreciate it!!
Solution
program
Function myRGB(r, g, b)
Dim clr As Long, src As Range, sht As String, f, v
If IsEmpty(r) Or IsEmpty(g) Or IsEmpty(b) Then
clr = vbWhite
Else
clr = RGB(r, g, b)
End If
Set src = Application.ThisCell
sht = src.Parent.Name
f = \"Changeit(\"\"\" & sht & \"\"\",\"\"\" & _
src.Address(False, False) & \"\"\",\" & clr & \")\"
src.Parent.Evaluate f
myRGB = \"\"
End Function
Sub ChangeIt(sht, c, clr As Long)
ThisWorkbook.Sheets(sht).Range(c).Interior.Color = clr
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Count = 1 Then
If .Column < 4 Then
Cells(.Row, 4).Interior.Color = RGB(Cells(.Row, 1), Cells(.Row, 2), .Cells(.Row, 3))
End If
End If
End With
End Sub
