Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2008

Tip: Looking for answers? Try searching our database.

Taking and storing pictures faster

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joe - 01 May 2008 14:58 GMT
Hi

I have a form which I can link pictures that are previously stored on my
computer, just like Northwind.

But I wonder if I can have a button which I can press, take a picture, and
instantly my pic would be linked to the record I'm on?

I know I can make a button open my webcam software, but afterwards I need
another button to "manually" link the pic to the record. Is there a way I can
simplify this?

Thanks in advance for any ideas :)
Klatuu - 01 May 2008 15:20 GMT
The only thing I can think of would be to use your form to control that.  Use
the form's timer event so it periodically checks for a new file in the folder
where the pictures are stored and when one is detected, use the new file name
to link to the picture.
Signature

Dave Hargis, Microsoft Access MVP

> Hi
>
[quoted text clipped - 9 lines]
>
> Thanks in advance for any ideas :)
Joe - 01 May 2008 18:29 GMT
Sounds interesting, any ideas how to do this? And just FYI, Im running access
2007. And what I have in mind is just like an employee database, in which I
have to take a pic of the person and store it in his record.



> The only thing I can think of would be to use your form to control that.  Use
> the form's timer event so it periodically checks for a new file in the folder
[quoted text clipped - 14 lines]
> >
> > Thanks in advance for any ideas :)
Klatuu - 01 May 2008 19:05 GMT
I would suggest using two different subfolders in one Pictures folder. One
for pictures not yet added to the database and one for those already added.

It would be like
c:\pictures
c:\pictures\new
c:\pictures\filed

Then in the time event, use the Dir function to see if a new file is in the
new folder and if so, add its name to the database, then use the Name
statement to move the file to the filed folder

Const conSourcePath As String = "c:\pictures\new\"
Const conDestPath As String = "c:\pictures\filed\"
Dim strFileName As STring

   strFileName = Dir(conSourcePath)
   If strFileName <> vbNullString Then    'New Picture Found
       Name conSourcePath & strFileName As conDestPath & strFileName
       Me.txtPictureFile = conDestPath & strFileName
   End If
Signature

Dave Hargis, Microsoft Access MVP

> Sounds interesting, any ideas how to do this? And just FYI, Im running access
> 2007. And what I have in mind is just like an employee database, in which I
[quoted text clipped - 20 lines]
> > >
> > > Thanks in advance for any ideas :)
Joe - 02 May 2008 06:03 GMT
Ok, sounds great, Ill try it out. Just one more question, if there's a
filename that already exists on the "filed" folder, how can I prevent it to
be overwriten? I suppose you can come up with a code to change the name (like
adding a number) to the filename? so nothing will be overwriten but renamed
instead if aplicable?

> I would suggest using two different subfolders in one Pictures folder. One
> for pictures not yet added to the database and one for those already added.
[quoted text clipped - 42 lines]
> > > >
> > > > Thanks in advance for any ideas :)
Klatuu - 02 May 2008 15:19 GMT
That would be a reasonable thing to do.  You could use the Dir function to
check for the existance of the file and if found, rename the file:

Const conSourcePath As String = "c:\pictures\new\"
Const conDestPath As String = "c:\pictures\filed\"
Dim strFileName As String
Dim strCheckFile As String
Dim lngFileNo As Long

   strFileName = Dir(conSourcePath)
   If strFileName <> vbNullString Then    'New Picture Found
       strCheckFile = Dir(conDestPath & strFileName)
       Do While strCheckFile <> vbNullstring
           lngFileNo = lngFileNo + 1
           strFileName = strFileName & Format(lngFileNo, "00")
           strCheckFile = Dir(conDestPath & strFileName)
       Loop

       Name conSourcePath & strFileName As conDestPath & strFileName
       Me.txtPictureFile = conDestPath & strFileName
   End If

Signature

Dave Hargis, Microsoft Access MVP

> Ok, sounds great, Ill try it out. Just one more question, if there's a
> filename that already exists on the "filed" folder, how can I prevent it to
[quoted text clipped - 48 lines]
> > > > >
> > > > > Thanks in advance for any ideas :)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.