I tried amrut's suggestion (as stated earlier, I've tried this before) and still can't get that to work. I know it's supposed to because before Access 2007 the only way to have dynamic image display in forms and reports was with VBA. Access 2007 introduced the ControlSource property to Image control so code is not required. However, can't set the ControlSource property with VBA and setting Picture property with VBA isn't working for me. The code runs without error but simply does not display image.
Take advantage of the ControlSource property by having a table of images with a record for each image. Text field for the characters and Attachment field to hold the images. Bind form to the table, bind Image control to the Attachment field holding the images, then code in textbox KeyUp event filters the form records to display appropriate sign.
Code:
Option Compare Database
Option Explicit
Private Sub Text0_KeyUp(KeyCode As Integer, Shift As Integer)
If (KeyCode >= 48 And KeyCode <= 57) Or (KeyCode >= 65 And KeyCode <= 90) Or (KeyCode >= 97 And KeyCode <= 122) Then
Me.Filter = "Char='" & Chr(KeyCode) & "'"
Me.FilterOn = True
Me.imgChar.Visible = True
End If
End Sub
Otherwise only other approach I could suggest requires 36 Image controls on a form and a single textbox for entering letters and this code:
Code:
Option Compare Database
Option Explicit
Public strImage As String
Private Sub Text0_KeyUp(KeyCode As Integer, Shift As Integer)
'This should handle digits 0 through 9 and letters (upper or lower case).
If strImage <> "" Then Me(strImage).Visible = False
If (KeyCode >= 48 And KeyCode <= 57) Or (KeyCode >= 65 And KeyCode <= 90) Or (KeyCode >= 97 And KeyCode <= 122) Then
strImage = "img" & Chr(KeyCode)
Me(strImage).Visible = True
End If
End Sub