PC Review


Reply
Thread Tools Rate Thread

Button to Search Windows Explorer

 
 
Kedd123
Guest
Posts: n/a
 
      3rd Jul 2009

I have a field that contains the path to a picture and an image control that
displays the picture on a form. Is it possible to create a button to browse
windows explorer and allow a user to select the picture and paste the
picture's path name into the text field?

I am looking for a way around typing a long path name and file name each
time a link to a picture needs to be added to a record in the database.

Thanks for the help!
 
Reply With Quote
 
 
 
 
Jack Leach
Guest
Posts: n/a
 
      3rd Jul 2009

No problem... what you need is some common dialog APIs. See this:

http://www.mvps.org/access/api/api0001.htm

copy & paste into a new standard (not a form) module and call the dialog
like so:

Me.TextBoxControl = GetOpenFile("C:\", "Please Select File")

This will open the File Open dialog and passed the selected file to your
control (or a string variable if you prefer). If you go through the list of
APIs (and everything else) at MVPS you'll see some for selecting folders,
starting applications, etc. Very handy stuff here.

hth


--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)



"Kedd123" wrote:

> I have a field that contains the path to a picture and an image control that
> displays the picture on a form. Is it possible to create a button to browse
> windows explorer and allow a user to select the picture and paste the
> picture's path name into the text field?
>
> I am looking for a way around typing a long path name and file name each
> time a link to a picture needs to be added to a record in the database.
>
> Thanks for the help!

 
Reply With Quote
 
Jack Leach
Guest
Posts: n/a
 
      3rd Jul 2009

FYI, a common way to handle pictures for records in forms is to use an
unbound picture control with the path stored in the record. Then on the
form's Current event set the image control's Picture property to the path
stored in the table.

Private Sub Form_Current
Me.PicControl.Picture = Me![PicturePathField]
End Sub

People sometimes decide to use an OLE field to store the picture, which is a
complete waste of resources in almost all cases. This way you store only the
path, not the picture itself. Just make sure the pics are in a controlled
folder and the paths aren't going to change.

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)



"Jack Leach" wrote:

> No problem... what you need is some common dialog APIs. See this:
>
> http://www.mvps.org/access/api/api0001.htm
>
> copy & paste into a new standard (not a form) module and call the dialog
> like so:
>
> Me.TextBoxControl = GetOpenFile("C:\", "Please Select File")
>
> This will open the File Open dialog and passed the selected file to your
> control (or a string variable if you prefer). If you go through the list of
> APIs (and everything else) at MVPS you'll see some for selecting folders,
> starting applications, etc. Very handy stuff here.
>
> hth
>
>
> --
> Jack Leach
> www.tristatemachine.com
>
> "I haven't failed, I've found ten thousand ways that don't work."
> -Thomas Edison (1847-1931)
>
>
>
> "Kedd123" wrote:
>
> > I have a field that contains the path to a picture and an image control that
> > displays the picture on a form. Is it possible to create a button to browse
> > windows explorer and allow a user to select the picture and paste the
> > picture's path name into the text field?
> >
> > I am looking for a way around typing a long path name and file name each
> > time a link to a picture needs to be added to a record in the database.
> >
> > Thanks for the help!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't use Desktop Search when pressing Search button in Explorer Chad Windows XP Help 2 16th Apr 2007 06:25 AM
explorer search button tom Windows XP Help 6 10th Aug 2006 05:11 PM
Win Explorer "Search" button on tool bar launches web search instead of Search Assistant T Pagano Microsoft Windows 2000 0 21st Jan 2004 11:53 PM
Windows Explorer "Search" button on tool bar launches web search instead of Search Assistant T Pagano Microsoft Windows 2000 New Users 0 21st Jan 2004 11:13 PM
Windows Explorer Search Button Does not start. It replys with the apllication er Joe Microsoft Windows 2000 0 6th Sep 2003 03:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:46 PM.