I have a field as MFG.

i want to use an if condition to see if MFG=DELL or HP. if it is, I want to change that cell's color in the datagridview to green..only those cells under MFG column should turn green

but if i said

if(mfg...) it considers MFG as a string and says that it is not declared..how do i do it ?

i am working on VB 2005 and access 2003

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        With ComboBox1
            If .Text = "dell" Then
                DataGridView1.......
            ElseIf .Text = "hp" Then
                DataGridView1.........
            Else

                DataGridView1.........
            End If
        End With
    End Sub

I have a field as MFG.

i want to use an if condition to see if MFG=DELL or HP. if it is, I want to change that cell's color in the datagridview to green..only those cells under MFG column should turn green

but if i said

if(mfg...) it considers MFG as a string and says that it is not declared..how do i do it ?

i am working on VB 2005 and access 2003

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.