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 / New Users / October 2007

Tip: Looking for answers? Try searching our database.

GetFileName Property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fayyu10 - 05 Oct 2007 13:07 GMT
Hello,

I'm trying to figure out a way on bringing a file look a dialogue box to
insert a picture into my database. Can you please give me the simplest method
that would allow me to accomplish this since I'm not very familiar with the
VB Codes.

Thanks,
Your help is appreciated in advance
Douglas J. Steele - 05 Oct 2007 14:29 GMT
Realistically, while there might be slightly simpler approaches than what's
shown in http://www.mvps.org/access/api/api0001.htm at "The Access Web",
none are as good.

It really doesn't matter how familiar you are with VB. Copy everything in
the shaded section (between Code Start and Code End) and paste it into a new
module (not a class module nor a module associated with a form or report).
Make sure you do not name the module the same as any of the routines within
it. (I usually prefix all my modules with mdl or bas to avoid this problem).

Then, whenever you want to call the dialog, you use the code at the top of
the page. To allow the user to select a GIF, JPEG or PNG file, you'd use
something like:

Dim strFilter As String
Dim strInputFileName as string

 strFilter = ahtAddFilterItem(strFilter, "Graphic Files (*.gif, *.jpg,
*.png)", _
   "*.gif;*.jpg;*.jpeg;*.png")
 strInputFileName = ahtCommonFileOpenSave( _
   Filter:=strFilter, OpenFile:=True, _
   DialogTitle:="Please select an input file...", _
   Flags:=ahtOFN_HIDEREADONLY)

The variable strInputFileName would hold the name of the selected file (or a
zero-length string) once the user closes the dialog.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Hello,
>
[quoted text clipped - 7 lines]
> Thanks,
> Your help is appreciated in advance
 
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.