jason12776
Technical User
I have a project where I connect an ADO control to an Access 2000 database, and using a datagrid as the result of a search. When clicking through the ADO, a picture will appear with each relavent record, a different picture for each record, now...for testing purposes, I have the datagrid attached to the same ADO and when I try to click on the datagrid to change the record, all my text fields will change, but the picture will not. I get an error, run-time error 13, type mismatch. Here is my code.
Private Sub DataGrid1_Click()
If DataGrid1.ColContaining(txtID.Text) Then
showMovieCover
End If
End Sub
I doubt I'm using the datagrid properly for this. Any assistance will be greatly appreciated.
Cheers.
The code for the showMovieCover is:
Private Sub showMovieCover()
Dim fso
Dim image
Dim noImage
image = "C:\program files\DVD\Covers\" & txtID.Text & ".jpg"
' used if no image is avaliable
noImage = "C:\program files\DVD\Covers\none.jpg"
Set fso = CreateObject("Scripting.FileSystemObject"
If fso.fileexists(image) = True Then
Picture1.Picture = LoadPicture(image)
Picture1.AutoSize = True
Else
Picture1.Picture = LoadPicture(noImage)
Picture1.AutoSize = True
End If
End Sub
Private Sub DataGrid1_Click()
If DataGrid1.ColContaining(txtID.Text) Then
showMovieCover
End If
End Sub
I doubt I'm using the datagrid properly for this. Any assistance will be greatly appreciated.
Cheers.
The code for the showMovieCover is:
Private Sub showMovieCover()
Dim fso
Dim image
Dim noImage
image = "C:\program files\DVD\Covers\" & txtID.Text & ".jpg"
' used if no image is avaliable
noImage = "C:\program files\DVD\Covers\none.jpg"
Set fso = CreateObject("Scripting.FileSystemObject"
If fso.fileexists(image) = True Then
Picture1.Picture = LoadPicture(image)
Picture1.AutoSize = True
Else
Picture1.Picture = LoadPicture(noImage)
Picture1.AutoSize = True
End If
End Sub