londonkiwi
Programmer
Any advice appreciated.
Having problems getting image to load in an unbound object frame, based on selction made in combo box.
Tried this code in Combo UafterUpdate event:
Private Sub cboBridgeID_AfterUpdate()
Dim rs As DAO.Recordset
Dim db As DAO.Recordset
Dim strSQL As String
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[BridgeID] = " & Me![cboBridgeID]
Me.Bookmark = Me.RecordsetClone.Bookmark
Set db = CurrentDb
' have access load and run the qry
strSQL = "Select * from qryBridgePhotos where qry.ID=" & Me!cboBridgeID & ";"
Set rs = db.OpenRecordset(strSQL)
If rs.BOF And rs.EOF Then ' nothing to do
Else
'On Error Resume Next
Me![ImageFrame1].Picture = rs.Fields("9798_pht1"
End If
End Sub
Get type mismatch error(13). Look forward to your comments.
Having problems getting image to load in an unbound object frame, based on selction made in combo box.
Tried this code in Combo UafterUpdate event:
Private Sub cboBridgeID_AfterUpdate()
Dim rs As DAO.Recordset
Dim db As DAO.Recordset
Dim strSQL As String
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[BridgeID] = " & Me![cboBridgeID]
Me.Bookmark = Me.RecordsetClone.Bookmark
Set db = CurrentDb
' have access load and run the qry
strSQL = "Select * from qryBridgePhotos where qry.ID=" & Me!cboBridgeID & ";"
Set rs = db.OpenRecordset(strSQL)
If rs.BOF And rs.EOF Then ' nothing to do
Else
'On Error Resume Next
Me![ImageFrame1].Picture = rs.Fields("9798_pht1"
End If
End Sub
Get type mismatch error(13). Look forward to your comments.