using webbrowser active x (1 Viewer)

tragik

Registered User.
Local time
Yesterday, 19:47
Joined
Jun 22, 2009
Messages
36
Can someone help me understand how I can do this. I understand how to build something to show a webpage ( http://www.datapigtechnologies.com/flashfiles/webbrowserctrl.html ) but i want to change this up a bit..

I have a form and it shows the current record with a full a subform below it.. now each record has a hyperlink field (access 2007). I would love some way to make it where the current record shown (not the sub form, but like when you "add existing fields" to a form) hyperlink field would be displayed in the broswer window (not an IE progam but in the form).

example of hyperlink i am using (local on pc) images\fs\19\3\file.jpg

or help on how to call onto the data from a certain field..

any guidance would be great thanks.
 

John Big Booty

AWF VIP
Local time
Today, 12:47
Joined
Aug 29, 2005
Messages
8,262
If I've understood correctly, what you want is for the Browser to automatically load the Hyperlink in the current record.

The following code in the Form's On Current event should do the trick;
Code:
Me.BrowserName.Navigate Me.FieldName [COLOR="SeaGreen"]' Where is the FieldName of the field that hold the hyperlink[/COLOR]
 

tragik

Registered User.
Local time
Yesterday, 19:47
Joined
Jun 22, 2009
Messages
36
Thanks John, after some testing and poking i got it.. but... it doesn't seem to show my image.. .jpg file.. says page can not be found.. now if i change the hyperlink in cell/table Reviews_Image to say www.google.com it works great!!!

even if i change the path from
images\fs\19\3\image.jpg
to
c:\access\images\fs\19\3\image.jpg
still wont work.. hmmm..
___________________________

Private Sub Reviews_Image_AfterUpdate()
Me.WebBrowser3.Navigate Me.Reviews_Image
End Sub

Private Sub Reviews_Image_BeforeUpdate(Cancel As Integer)
Me.WebBrowser3.Navigate Me.Reviews_Image
End Sub
 

tragik

Registered User.
Local time
Yesterday, 19:47
Joined
Jun 22, 2009
Messages
36
to add a side note, it says "navigation to the webpage was canceled"
 

John Big Booty

AWF VIP
Local time
Today, 12:47
Joined
Aug 29, 2005
Messages
8,262
Not sure what's going on. I've just tired putting a local path into my test DB and it works fine in the browser window.

If all you want to do is show a local image associated with each record, you could use an image frame and the following code in your form's On Current event;

Code:
Me.ImageName.Picture = Me.ImagePath
 

tragik

Registered User.
Local time
Yesterday, 19:47
Joined
Jun 22, 2009
Messages
36
* ok John, screen shot fixed.
** think i found that oncurrent you were mentioning..let me try that one!
** nope still no dice.. lol could you go into more detail about that 'image frame'?

Hey john, once again thank you for replying.. here is a screen shot of my access test (do everything in the test database first) in design view..

for one, i cant see me to find the on current you are mentioning.. am i missing something?

http://img508.imageshack.us/img508/3606/access5.jpg

i did the web link rather than bombard my post with a big image.
 
Last edited:

John Big Booty

AWF VIP
Local time
Today, 12:47
Joined
Aug 29, 2005
Messages
8,262
To find the Form's On Current event, put the form into design view. There is a small square in the upper left hand corner of the window at the point were the vertical and horizontal rulers would intersect. When you first put the form into design view there should be a small black square in this area. This indicates that the properties window is showing you From properties rather than an individual control property. If you click on a control and wish to return to the form properties simply click in the empty square.
 

tragik

Registered User.
Local time
Yesterday, 19:47
Joined
Jun 22, 2009
Messages
36
still not getting very far.. i tried adding the image box and then doing your suggestion.. i get a critial error and crashes my form.. debug and it takes me to the line on current event.. not sure why the iexplorer active x wont handle my jpg.. or gif..
 

tragik

Registered User.
Local time
Yesterday, 19:47
Joined
Jun 22, 2009
Messages
36
thank you thank you John.. let me give that a try when i get to work..
 

tragik

Registered User.
Local time
Yesterday, 19:47
Joined
Jun 22, 2009
Messages
36
John, quick question. ( i like to ask dumb questions, it's those that stop ya) i noticed that your image is a .png.. would it matter if mine are jpg's???

I tried to incorporate my own image into where you flag would go, rather my image is MUCH larger in size and MB. when i start the form it gives me a error and debugs to
Private Sub Form_Load()

----> Me.Image5.Picture = Me.Combo2.Column(2)

End Sub

John, i have a encrypted server with some example images on it, could you take a look at them? maybe my image sizes are to large (not mb but resolution)..
go to :

https://spideroak.com/browse/share/MJURGENSEN/Access


it will show you a folder called "01", this is my issue 01, if you click on it you can see a list of images. these are my scanned pages of the magazine. you can then hit the 'download' button to the right of the image.. or select the name and should show you a preview.
 

John Big Booty

AWF VIP
Local time
Today, 12:47
Joined
Aug 29, 2005
Messages
8,262
John, quick question. ( i like to ask dumb questions, it's those that stop ya) i noticed that your image is a .png.. would it matter if mine are jpg's???

......

Shouldn't make any difference. The only reason mine is a png is that the way the images came.

.....

I tried to incorporate my own image into where you flag would go, rather my image is MUCH larger in size and MB. when i start the form it gives me a error and debugs to
Code:
Private Sub Form_Load()

    --->  Me.Image5.Picture = Me.Combo2.Column(2)

End Sub
..........

What you need to do is have a look at the query that is populating the Combo, you will find that Column(2) is the field that holds the path for the image, so you will need to go into the table and put your image path in the appropriate field then the code should work.

.......

John, i have a encrypted server with some example images on it, could you take a look at them? maybe my image sizes are to large (not mb but resolution)..
go to :

https://spideroak.com/browse/share/MJURGENSEN/Access


it will show you a folder called "01", this is my issue 01, if you click on it you can see a list of images. these are my scanned pages of the magazine. you can then hit the 'download' button to the right of the image.. or select the name and should show you a preview.

Can't promise anything at this point, but if I get a moment I'll have a look.
 

tragik

Registered User.
Local time
Yesterday, 19:47
Joined
Jun 22, 2009
Messages
36
Thanks John, i will re-look at what you are talking about.. if you have time.. i am just glad you took the time to reply.. thanks
 

John Big Booty

AWF VIP
Local time
Today, 12:47
Joined
Aug 29, 2005
Messages
8,262
OK here's an amended version of the DB, you will need to create a Folder on your Desk top called Images, copy all your images to that folder. You will need to do this prior to opening the DB.
 

Attachments

  • Images.zip
    78 KB · Views: 150

tragik

Registered User.
Local time
Yesterday, 19:47
Joined
Jun 22, 2009
Messages
36
Thank you John, i can better understand what i am doing wrong.. thank you for putting the time into this.. i have done the scale thinging..thanks so much ..have a great night John.
 

Cosmo

Registered User.
Local time
Yesterday, 22:47
Joined
Feb 3, 2011
Messages
19
If I've understood correctly, what you want is for the Browser to automatically load the Hyperlink in the current record.

The following code in the Form's On Current event should do the trick;
Code:
Me.BrowserName.Navigate Me.FieldName [COLOR=seagreen]' Where is the FieldName of the field that hold the hyperlink[/COLOR]


------
I am confussed, there is no available "Navigate" property available in the list of properties for the webbrowser control. And it doesn't come up with the "intelisence" feature. When I try to use "me.webbrowser667.navigate" it craps out. What Iam I missing about accessing properties that don't explicitly exist in the property boxes????
 

Cosmo

Registered User.
Local time
Yesterday, 22:47
Joined
Feb 3, 2011
Messages
19
Thanks John, after some testing and poking i got it.. but... it doesn't seem to show my image.. .jpg file.. says page can not be found.. now if i change the hyperlink in cell/table Reviews_Image to say www.google.com it works great!!!

even if i change the path from
images\fs\19\3\image.jpg
to
c:\access\images\fs\19\3\image.jpg
still wont work.. hmmm..
___________________________

Private Sub Reviews_Image_AfterUpdate()
Me.WebBrowser3.Navigate Me.Reviews_Image
End Sub

Private Sub Reviews_Image_BeforeUpdate(Cancel As Integer)
Me.WebBrowser3.Navigate Me.Reviews_Image
End Sub
-----------------------------------------------------------

I am confussed, there is no available "Navigate" property available in the list of properties for the webbrowser control. And it doesn't come up with the "intelisence" feature. When I try to use "me.webbrowser667.navigate" it craps out. What Iam I missing about accessing properties that don't explicitly exist in the property boxes????
 

Users who are viewing this thread

Top Bottom