I have a continuous form where each record contains a "box color name" field. The form has an un-bound image control wherein I want to dynamically set the picture property as the form populates. I tried to bind the image control with a function reference where the function would obtain the "box color" and set the image control accordingly. However, Access issues an error indicating it can't Open the link reference. I really need the function, or some mechanism, to test the value of "BoxColor", as it can be null.
Code:
Option Compare Database
Option Explicit
Public Function SetBox(BoxName As Variant)
If Not IsNull(BoxName) Then Me.imBox.Picture = "c:\Meds\" & BoxName & ".jpg"
End Function
The appropriate image changes with each record, so maybe I need to learn a new method?