Question: I want some records in my Access Datasheet Form to flash (switch from one color to another one) depending on the value in a given field.

I found some great help on [there](https://www.techonthenet.com/access/forms/flashing2007.php) by using the On Timer event of the Form but for some reason it doesn't work for me.
I suppose it is because in my case, my form is displayed in **Datasheet View**.

Also, I realized that it only checks the value of the active record but I would like it to check the value of all the records for that given field (via SQL maybe ?)

Is it even possible to change the back color of a record via VBA in Access or the only way is via the conditional formatting tool ?

I am a bit confused on how to proceed and if there is even a way to do so.

Any ideas on how to do this ?

```
Private Sub Form_Timer()

   If [Receiver] = "Martin" Then
       If [Receiver].ForeColor = 0 Then 'vbRed
          [Receiver].ForeColor = 255 'vbBlack
       Else
          [Receiver].ForeColor = 0 'vbRed
       End If
   End If

End Sub

```

Answer: 
You are adding target to `UIImageView`, it's not work please check below code 

```
    let btn1 = UIButton(type: .custom)
    btn1.setImage(UIImage(named: "imagename"), for: .normal)
    btn1.frame = CGRect(x: 0, y: 0, width: 30, height: 30)
    btn1.addTarget(self, action: #selector(openMaps), for: .touchUpInside)
    let item1 = UIBarButtonItem(customView: btn1)

    self.navigationItem.setRightBarButtonItems([item1], animated: true)

```
why don't you just use a UIButton and assign it as bar button item as suggested in this thread:

[UIBarButtonItem: target-action not working?](https://stackoverflow.com/questions/2796438/uibarbuttonitem-target-action-not-working)

```
    let button  = UIButton(type: .custom)
    if let image = UIImage(named:"icon-menu.png") {
        button.setImage(image, for: .normal)
    }

    button.frame = CGRect(x:0.0, y:0.0, width: 30.0, height: 30.0)
    button.addTarget(self, action: #selector(MyClass.myMethod), for: .touchUpInside)
    let barButton = UIBarButtonItem(customView: button)
    navigationItem.leftBarButtonItem = barButton

```