
Linking Images to a table
Hi David
thanks for the code, but I already got this part working
my main problem is getting the image grabbing program to use my ID as the
save name
at the moment I have 2 macros working
1) copy the ID
Open the program
now after taking the picture I only need to paste
2)set image Path
I'd like to add these 2 in this order
and getting the ID to be pasted automatically in the other program
thanks again
Gal
Hi Gal,
I had to link word doc's to certain persons (one doc per person). In my db
one
just has to click a button to view the document. The doc's are saved as
Lastname_Firstname.Doc. Here is the code you may want to put into the
FormCurrent event. It needs a "picturefield" named MyPicture and should be
linked to the picture you want to display when no current picture is
available.
I used three more field: FistName, LastName and FileName. Furthermore there
is a
commandbutton to unhide/hide the field FileName in case I need a different
filename (see below for explanation). It's hidden so, as not to confuse my
users
;-). I adapted the code so it will display bitmaps but i didn't test it so
be
careful.
HTH David
'Code Start
Private Sub FormCurrent()
On Error GoTo Err_FormCurrent
Dim MyFile As String, MyPath As String
'First check wether there is a special filename saved in the hidden field
[FileName]
'in case the name is twice there or reads like Donna Dolores Ascension dela
Rose
de Purificacion...
If isNull([FileName]) Then
MyFile = [LastName] & "_" & [FirstName] & ".bmp" 'Get normal
filename
else
MyFile = [FileName]
End If
MyPath = "C:\whateverpath\"
Me.MyPicture.Picture = MyPath & MyFile
Exit_FormCurrent:
Exit Sub
Err_FormCurrent:
If Err.Number = 2220 Then 'No picture found
'Fill in code to happen if no picture available
Resume Exit_FormCurrent
end if
MsgBox Err.Description, , Err.Number
Resume Exit_FormCurrent
End Sub
'Code End