Hello all I currently have a database using access 2007 where i have a table with countryList to populate a combo box to select a country on my form. This combo box is linked to an image control that displays the flag of the country selected. The pictrues are linked to a folder on drive c: called Flags. Now my problem is the following: When i choose the country the picture disp[lays properly using an after update event. However when i open the form with a record the flag does not display. So i added code to the current event on the form and it does not work. I want that if a country is selected that is shows the flag of the country and if no country is selected i want the picture to display a defaulf flag icon.
Here is the code:
Private Sub Combo29_AfterUpdate()
Dim strPath As String
strPath = Me.Combo29.Column(2)
Image31.Picture = strPath
End Sub
The above part work perfectly..........
This part below is where the problem lies...
Private Sub Form_Current()
Dim strPath As String
Dim defPath As String
defPath = "c:\Flags\Default.jpg"
strPath = Me.Combo29.Column(2)
If Me.Combo29.Column(2) <> Null Then
Image31.Picture = strPath
Else
Image31.Picture = defPath
End If
End Sub
I get error 94 inproper use of Null
Where am i going wrong
PS I am new to programming VBA (obviously)
Thanks
Ron