Continous forms - what event to use to display images?

  • Thread starter Nicolae Fieraru
  • Start date
N

Nicolae Fieraru

Hi All,

I have a continuous form and I display various records in it. Beside these
records, I added an image and I want to use VBA to display the image
corresponding to the specific record. Using the code in the OnCurrent event
seems to be executed only once, for all the records, not for every record
and every record displays the image of the first record.
I used the following code in the OnCurrent event of the form:

Private Sub Form_Current()
Dim ImgPath
On Error Resume Next
If (Len(gImagePath) = 0) Then
modVars.InitVars
End If
ImgName = Me![JigImage]
If (Len(ImgName) > 0) Then
ImgPath = gImagePath & GenFolderName(JigNo) & JigImage
Me![ImgPath].SetFocus
Me![ImgPath].Text = ImgPath
Else
ImgName = "noimg.jpg"
ImgPath = gImagePath & ImgName
Me![ImgPath].SetFocus
Me![ImgPath].Text = ImgPath
End If
If FileExists(ImgPath) Then
Me![ImageFrame].Picture = ImgPath
Else
ImgName = "noimg.jpg"
ImgPath = gImagePath & ImgName
Me![ImageFrame].Picture = ImgPath
End If
End Sub

Any idea would be appreciated.

Regards,
Nicolae
 
A

Albert D.Kallal

I don't think you are going to have any success at all trying to displays
multi-images with a continues form (you can't do that).

What I would suggest is that you put a continues (sub from) on the left side
of the screen, and as the user moves through each record, you display the
picture on the right side of the screen.

I have some screen shots of side by side forms here:

While the above does not have a picture on the right side, it will give you
and idea. The above screen shots shows how you can have a continues form,
and for each record show anther continues form (details) for that record.
So, while you can't have a continues form inside of a continues form, you
can clearly solve the problem by using the above idea of side by side.

And, if you MUST have pictures, then you can resort to a 3rd party control.
A nice control called t-list can be found here:

http://www.bennet-tec.com/btproducts/tlist/TListScreenShots.htm

That control works quite well with ms-access.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top