Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 3rd, 2003, 06:20 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Melbourne, Vic, Australia.
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default Web images in Access XP

Does anyone know how I would go about putting an image from the web onto a form, or (preferably) have it as an OLE object type deal that links to an image on the net?

Basically, what I want to do is rather than have the image being something like C:\image.jpg, it should be http://www.mydomain.com/image.jpg

Basically, there's a heap of photos of people on the net, and I'd rather link to those files rather than store the images again.

I don't have FTP access to the server either:(, which would probably be one way around it.

Any ideas?

Steven

I am a loud man with a very large hat. This means I am in charge
__________________
<hr noshade size=\"1\"><i><font color=\"blue\">I am a loud man with a very large hat. This means I am in charge</i></font id=\"blue\">
Reply With Quote
  #2 (permalink)  
Old September 10th, 2003, 01:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Hi Steve,

This should work in A2K on up:

1. Create a table to hold your URLs (tblURL).
2. Create a new form, and set the form's record source to tblURL.
3. Add a textbox to the form and set its control source to the field in tblURL that stores your URLs. Name it txtURL.
4. From the Insert menu, select ActiveX Control, then select Microsoft Web Browser. Name the new Web Browser control actx_WebBrowser. You can size the Web Browser control any way you like.
5. Open the VBA IDE and set a reference to Microsoft Internet Controls (shdocvw.dll)
6. Paste the following code in your form’s Current event:

Private Sub Form_Current()
    Dim objIE As SHDocVw.InternetExplorer
    Dim strURL As String

    txtURL.SetFocus
    strURL = Me.txtURL.Text

    Set objIE = Me.actx_WebBrowser.Object
    objIE.Navigate strURL
End Sub

7. Open the form. The site for the first URL listed in tblURL should display. The Web Browser control is even smart enough to connect to the internet if you don't already have an active connection.

Now, as you navigate through the forms record source, the code will read the URL from the textbox, and display the associated Web Page in your Web Browser control.

HTH,

Bob


Reply With Quote
  #3 (permalink)  
Old September 10th, 2003, 06:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Melbourne, Vic, Australia.
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So Bob, how many times today have you been told that you're a genius?

Thanks heaps

Steven

I am a loud man with a very large hat. This means I am in charge
Reply With Quote
  #4 (permalink)  
Old September 10th, 2003, 08:57 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

LOL, thanks Steven

Actually, it has a lot more to do with genus than genius, genus Neotoma to be precise; you know, the familiar North American pack rat, those clever little creatures who collect in and around their nests a great variety of small objects. I figure VB objects are as good as any.

Which brings me to a perfect application of the embedded browser concept! I maintain several Access databases of newgroup postings that I find particularly useful, and its always been a bit of a pain toggling back and forth between IE and Access, cutting and pasting. With an embedded browser, I can do my "post harvesting" from a single Access form, which is mighty convenient.

In fact, I just sent this post from an Access app. Clicking the message preview button actually opens an instance of the Wrox message preview dialog independently of my Access form, just as though it were part of Acces's Multiple Document Interface. Kinda' cool. Thanks for thinkin' outside the box. Oh, the control does seem to have some sizing issues. Seems to be maxing out in about a 6" square at the moment. Have to play with that a bit.

Regards,

Bob

Reply With Quote
  #5 (permalink)  
Old September 10th, 2003, 11:13 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Melbourne, Vic, Australia.
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'll admit, that the sizing issue is, well, an issue, but the way I got around it was this (and don't ask me why it works - it just does)

Insert the ActiveX control, and resize it straight away, befor you do ANYTHING else to it - then it resizes ok. It's rather annoying, as I had to keep deleting and inserting the control while I previewed it to make sure that it was just right.

Doing things other than just making plain old databases, like putting this functionality in, sure does make my job a lot more fun


And just so that I can test this pop up window thing - I'm also posting this reply from Access

One slight problem I've noticed with it, in terms of posting however (and this may be just a local issue), is that pressing Enter does nothing - So in order to get these line breaks happening, I'm having to paste them in.

Steven

I am a loud man with a very large hat. This means I am in charge
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
win xp and web server Sus Beginning PHP 5 January 8th, 2006 10:40 AM
ADE file in Access 2000 <---> Access XP ginoitalo Access 3 April 14th, 2004 09:06 PM
Access XP Report mullay Access 1 December 30th, 2003 05:45 PM
What Web Server Can I Use with Windows XP Home Ed? alanw8472 Classic ASP Basics 1 October 10th, 2003 03:11 AM
Access XP VBA compatibility issues w/ Access 2000 bourgeois02 Access VBA 1 August 19th, 2003 04:14 PM



All times are GMT -4. The time now is 08:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.