link TIFF to form thru text or combo box

G

Guest

I have the need to "link" a TIFF grafic to a form which shows info on a
specific part in a form. This form will have fields that are based on data
from SQL tables and then, hopefully, show a TIFF of the part. This TIFF would
only be called for if someone inputs (manually) the part number and hits
enter. We have standard parts which have an established parts number but not
for specially MFGed parts. All drawings are in the same network directory and
are TIFFs (you know, because of Autocad). Now the questions:

1. Is there a way on a form to show the TIFF in a window based on the part
number that I type in a text or combo box?
2. How can you scale the TIFF to fit in form's object frame, without
distorting (stretching one way but not another)? I'd perfer it to fill the
frame. What about viewr controls? Zoom?
3. Is there a way to base the combo box's "list" on the file names?. This
would ensure that you can easily pick the specials, which you won't know the
parts #'s for.For specials you would input the 6 digit job number whcih is
the prefix for the sprcial part #. I'd imagine I would need to create a
table that populates from the TIFF names in the directory that all TIFFs are
in. This probably should be updated when staring Access or the use of an
"update" button?

I don't have a clue how to code such a thing. Can some one help or point me
in a direction? Thanks ahead of time.
 
J

John Nurick

Hi Jackie,

Here are sample databases that handle images stored in external files:
PictureMgr: http://www.datastrat.com/DataStrat2.html
Larry Linson's: http://accdevel.tripod.com/imaging.htm

This function below returns the files from a folder as a string that can
be assigned to the "value list" for a combobox:

Function GetFilesAsValueList(FolderPath As String, _
FileType As String) As String
'Returns files of specified type from specified folder
'as a list suitable for the rowsource of a listbox
'By John Nurick 2005
Dim oFS As Object 'Scripting.FileSystemObject
Dim oFolder As Object 'Scripting.Folder
Dim oFile As Object 'Scripting.File
Dim strList As String
Const strDELIMITER = ";"

Set oFS = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFS.GetFolder(FolderPath)

If oFolder.Files.Count > 0 Then
For Each oFile In oFolder.Files
If oFS.GetExtensionName(oFile.Name) = FileType Then
strList = strList & oFile.Name & strDELIMITER
End If
Next
If Len(strList) >= 1 Then
GetFilesAsValueList = Left(strList, Len(strList) - 1)
End If
Else
GetFilesAsValueList = ""
End If
Set oFolder = Nothing
Set oFile = Nothing
Set oFS = Nothing
Exit Function
End Function
 

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