I was reading Thread702-840722, (now closed) and TheAceMan1 gave a suggestion for providing the common windows dialog for locations and file types that is below. I have a form that someone can add a photo from a text box. They can either manually enter the drive etc, but I'd like to give them the ... feature to pick the file themselves. How would one go about doing that? I did what TheAceMan1 said "go to the MenuBar click Insert ActiveX Control, but I don't have that option. I'm using Access 2003. Any ideas?
From thread and TheAceMan1:
Step 4
I decided to make it easy for you to enter your picture Path & FileNames by incorperating the Common Dialog Control (don't ask . . . just keep going!). Wether or not this can be done depends on your version of Access.
So on the MenuBar click Insert - ActiveX Control... A dialog opens. Scroll down thru the list. Your looking for: Microsoft Common Dialog Control, version 6. If you don't find it, you'll have to enter your Path & FileNames manually (in this case goto Quote 5).
If do have it, select it and click OK. A small square button will appear on the form. Just leave it, its hidden in form view.
In the Other Properties Tab for the new control, set the Name Property at the top:
Name = axCom
Now . . . . in the DoubleClick Event for the picPath control, add the following code:
Dim axCtl As Object
Set axCtl = Me!axCom
axCtl.DialogTitle = "Insert Picture Path & FileName"
axCtl.InitDir = "D:\Graphics\Misc"
axCtl.Filter = "Bitmaps (*.bmp)|*.bmp|Jpegs (*.jpg)|*.jpg|Gifs (*.gif)|*.gif"
axCtl.ShowOpen
Me!Text3 = axCtl.FileName
Set axCtl = Nothing
Compile & Save and close the form
From thread and TheAceMan1:
Step 4
I decided to make it easy for you to enter your picture Path & FileNames by incorperating the Common Dialog Control (don't ask . . . just keep going!). Wether or not this can be done depends on your version of Access.
So on the MenuBar click Insert - ActiveX Control... A dialog opens. Scroll down thru the list. Your looking for: Microsoft Common Dialog Control, version 6. If you don't find it, you'll have to enter your Path & FileNames manually (in this case goto Quote 5).
If do have it, select it and click OK. A small square button will appear on the form. Just leave it, its hidden in form view.
In the Other Properties Tab for the new control, set the Name Property at the top:
Name = axCom
Now . . . . in the DoubleClick Event for the picPath control, add the following code:
Dim axCtl As Object
Set axCtl = Me!axCom
axCtl.DialogTitle = "Insert Picture Path & FileName"
axCtl.InitDir = "D:\Graphics\Misc"
axCtl.Filter = "Bitmaps (*.bmp)|*.bmp|Jpegs (*.jpg)|*.jpg|Gifs (*.gif)|*.gif"
axCtl.ShowOpen
Me!Text3 = axCtl.FileName
Set axCtl = Nothing
Compile & Save and close the form