|
-
Jan 10th, 2002, 07:26 PM
#1
Thread Starter
Member
Make reference qry record source of form
Any advice appreciated. Beacon - took note of your comments, trying a diff approach!
Having problems getting image to load in an unbound object frame (imageFrame1), based on selction made in combo box.
Tried this code in Combo afterUpdate 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.
Nb it falls over at set db = Currentdb (= nothing) - why??
BridgeID is numeric.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|