Well, that's a rather tall order. One of the reasons I created the sample
databases is so you can pull them apart to see how they work. Nevertheless,
let me give you some background and then you can ask specific questions.
First, Import the module "modOpenSaveFile" into your application. Don't
make any changes to it.
Now, the way the thing works, is you call the "ahtCommonFileOpenSave"
function with the appropriate arguments and it returns a string that holds
the path and filename of the file you selected in the dialog box.
So in my PictureLoad sample, the call is behind the "Choose a Picture"
Button. The important part of the event procedure is this:
Dim strFilter As String
Dim lngFlags As Long
strFilter = ahtAddFilterItem(strFilter, "Picture Formats (*.jpg *.jpeg,
*.bmp, *.gif)", "*.jpg; *.jpeg; *.bmp; *.gif")
'MsgBox "You selected: " &
Filename = ahtCommonFileOpenSave(InitialDir:=pathname, _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Select Picture File")
'display picture
Me.txtStockGraph = Filename
Me.ImgStock.Picture = Filename
AS you can see, I'm calling the "ahtCommonFileOpenSave" function and
assigning the value to the variable "Filename". Then I assign the Filename
to a textbox on the form, which is how it gets entered into the table.
Exactly what YOU will do with Filename depends on your application.
You will also see that I assign a value to the variable strFilter. For the
PictureLoad sample, I only want to load picture formats. But you can change
this to include other file formats or ALL file formats. In the
"SetHyperlink" sample, I do this:
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
I hope this helps you get started.
--
--Roger Carlson
MS Access MVP
Access Database Samples:
www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L