Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHOTOs might burn your eyes out if web hosted.

Status
Not open for further replies.

RogueVW

Programmer
Oct 8, 2002
15
US
Quick look away!! This post must be toxic and might burn your eyes out and melt your fingers off your hand before you can reply to it. I have posted several times and can never ever ever get even a single reply. LOOK AWAY!!!!


We have moved an Access DB to a MYSQL DB that is web hosted and use a Ruby interface.

Creating elegant reports in Ruby is difficult and time consuming, so until then I have a front end Access DB linked to the hosted MYSQL back end for many of the reports.

I am having problems with creating reports with photos that are hosted on the web server. The method used and well documented on Tek-tips does not seem to work for hosted jpgs.

Description of the report would be an info page for each student with a photo of the included. The photos were stored locally but are now hosted on the webserver.

Currently:

Private Sub Group_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo NoPhoto_Err
Me![Photograph].Properties("Picture") = "c:\data\pictures\" + Me![LastName] + "_" + Me![FirstName] + Me![contactID]+".jpg"
Exit Sub

NoPhoto_Err:
If Err.Number = 2220 Then
Me![Photograph].Properties("Picture") = "c:\data\pictures\NoPhoto.jpg"
Else
MsgBox Err.Description
End If
End Sub

I would like to refer to the photo stored on the web such as:
Me![Photograph].Properties("Picture") = " + Me![LastName] + "_" + Me![FirstName] + Me![contactID]+".jpg"

This does not work.

Any ideas? Does Access even allow this?
 
The Picture property uses the address of the picture. Not sure if it supports hyperlinks or not, but even if it does, your naming convention will not work (really?). I would guess you would need a hyperlink for each image - appending a file name will not point to a valid logical address that the control is looking for. Conversely, storing the hyperlink addresses in a table and using that for the picture source may work. Sorry I don't have time to set up a test right now.

My eyes didn't burn too badly and I was able to continue using Access, here is what MS ACC help has to say:
Picture Property


You can use the Picture property to specify a bitmap or other type of graphic to be displayed on a command button, image control, toggle button, page on a tab control or as a background picture on a form or report. Buttons can display either a caption or a picture.

Setting

The Picture property contains (bitmap) or the path and file name of a bitmap or other type of graphic to be displayed.

You can set this property by using:

The property sheet. Click the Build button to the right of the property box (for command buttons and toggle buttons). When you select one of the bitmap files from the Available Pictures list, the property setting is (bitmap).


A macro.


Visual Basic. You can use a string expression that includes the path and the name of the graphic, as in the following example:
btnShowLogo.Picture = "c:\Windows\Winlogo.bmp"
The Picture command on the Insert menu (for image controls or background pictures on forms and reports) to select a bitmap or other type of graphic.

The default setting is (none). After the graphic is loaded into the object, the property setting is (bitmap) or the path and file name of the graphic. If you delete (bitmap) or the path and file name of the graphic from the property setting, the picture is deleted from the object and the property setting is again (none).

If the PictureType property is set to Embedded, the graphic is stored with the object.

Remarks

You can create custom bitmaps by using Microsoft Paintbrush or another application that creates bitmap files. A bitmap file must have a .bmp, .ico, or .dib extension. You can also use graphics files in the .wmf or .emf formats, or any other graphic file type for which you have a graphics filter. Forms, reports, and image controls support all graphics. Command buttons and toggle buttons only support bitmaps.

Buttons can display either a caption or a picture. If you assign both to a button, the picture will be visible, the caption won't. If the picture is deleted, the caption reappears. Microsoft Access displays the picture centered on the button and clipped if the picture is larger than the button.

Tip To create a command button or toggle button with a caption and a picture, you could include the desired caption as part of the bitmap and assign the bitmap to the Picture property of the control.

Beir bua agus beannacht!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top