Image in Continuous Form

bill crumpton

Registered User.
Local time
Today, 19:02
Joined
Apr 20, 2000
Messages
105
I have a form that shows the results of a parameter query. The properties set to Continuous. One of the result fields is an ole image box that shows the picture of a person. I have the following code in the 'On Current' property of the Form:

Private Sub Form_Current()
On Error Resume Next
Me![imageframe].Picture = Me![imagepath]
Me![imageframe].Requery
End Sub

When the results of the continuous form appear, the same photo for every person is the same as the first photo in the form, until I click on the recod then the picture will change to the proper picture.

For example, If I type in the name "Smith" in the parameter query 10 different "Smiths" appear as the result in the Form. Every Smith has the same picture as the very first Smith on the Form even though they are different people. BUT when I click on the record selector on the second record the picture will change.

How do I get all the correct pictures to show in all the records on the continuous forms without selecting the records? Thanks for your help.

BAC :confused:
 
This would work...?

Use a RST as a record source for the form... Use your results of the parameter query as a filter and appropriate relationships to have your path as part of the RST..
Then assign your RST as the recordsource for the form...
Would this not work?

Regards,
 
Thanks Brian. Help me out on how to do the RST please. New to me.


BAC
 
Private Sub Form_Load()
Dim db As Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
' VReply is your prompt
Set rs = db.OpenRecordset("SELECT tbl1.Path, tbl2.* FROM tbl1 INNER JOIN tbl2 ON tbl1.tbl1ID = tbl2.tbl2ID Where tbl2.FldX = " & VReply & ";", dbOpenDynaset)
Set Me.Recordset = rs
End Sub

Note if reply is text:
"SELECT tbl1.Path, tbl2.* FROM tbl1 INNER JOIN tbl2 ON tbl1.tbl1ID = tbl2.tbl2ID Where tbl2.FldX = '" & VReply & "';",

small ' quotes are needed.....
 

Users who are viewing this thread

Back
Top Bottom