Q: Showing Date and Photo
if you could give me a tip on how to display and a date that can include
year 2000s.
I would like again to ask you help on how to link a
field(particulary photo field) of my Database to an OLE or picturebox or
imagebox control. Its because I also use the same syntax as your in
assigning and accessing my database.
Dim DB As Database
Dim RS As Recordset
Set DB = OpenDatabase("Resource.mdb")
Set RS = DB.OpenRecordset("Members")
LastName = RS!LastName
FistName = RS!FirstName
Photo = ???????
How to link my photo field to my OLE or picturebox?
van@fcpp.fujitsu.co.jp
A:
What about Format(Now,"mm/dd/yyyy")? See the help on the VBcommand
Format
I would not include the photo into the database. Instead I would
do it like this: So for example you have your executable directory
and under it you have the directory containing the jpg's (gif's or
what else).
executable = c:\program files\members\members.exe
database = c:\program files\members\database\resource.mdb
photo = c:\program files\members\photo\*.jpg
I assume you give all the members an unique number? It's always good
to do so. This way you can renamed the photo of the member as
[memberID].jpg You don't need a field in the database, just call the
photo by it's path and name. So if you have memberID 12345 on the
screen and you want to see it's photo just make a little button
with some code that will do the trick: the path is always (in the
example) a directory under the executable so this would be App/Path &
"\photo\". The name of the photo is always the memberID + the
extension: in the example 12345.jpg
Sub Command1_Click()
Dim strPhoto As String
strPhoto = App.Path & "\photo\" & RS!MemberID & ".jpg"
Image1.Picture = strPhoto
'I'm not sure if you show it with this command but you can easily
'find it in the help
End Sub
Return