Web Browser Control (1 Viewer)

jdraw

Super Moderator
Staff member
Local time
Today, 04:03
Joined
Jan 23, 2006
Messages
13,479
HNTA,

You've told us a few things that don't work.
Could you tell us in simple term sWHAT you are trying to accomplish? And what constraints are involved? Perhaps an example (mock up) would clarify things (for me at least).
 
Local time
Today, 02:03
Joined
Dec 13, 2019
Messages
77
The web page below has dynamic values on the web page such as pressure, temperature, etc. I have attached a picture that you can see below to give you an idea of what it would look like...
Right now I just have a screenshot image of the web page that I click on a valve or piece of equipment and it brings up a form. This works great but I would ultimately like to do an overlay of command buttons over a live web version.
 

Attachments

  • Example.JPG
    Example.JPG
    34.4 KB · Views: 28

theDBguy

I’m here to help
Staff member
Local time
Today, 01:03
Joined
Oct 29, 2018
Messages
13,753
The web page below has dynamic values on the web page such as pressure, temperature, etc. I have attached a picture that you can see below to give you an idea of what it would look like...
Right now I just have a screenshot image of the web page that I click on a valve or piece of equipment and it brings up a form. This works great but I would ultimately like to do an overlay of command buttons over a live web version.
Hi. Okay, I had a chance to try it out. Did you mean something like this?

In Design View:
design.png


In Form View:
form.png
 
Local time
Today, 02:03
Joined
Dec 13, 2019
Messages
77
Hey theDBguy,

Can you explain how you did this? I'm assuming by the pictures that you figured it out.

Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:03
Joined
Oct 29, 2018
Messages
13,753
Hey theDBguy,

Can you explain how you did this? I'm assuming by the pictures that you figured it out.

Thanks
Hi. Sorry for the delay... While testing it out, I discovered that the buttons show up if the web browser control is disabled. So, all I did was use a Timer event to disable the web browser control and then turn off the timer. Hope that helps...
 

isladogs

CID VIP
Local time
Today, 09:03
Joined
Jan 14, 2017
Messages
14,268
Hmmm...doesn't work for me - tested in A2010 & A365
As soon as the browser control is enabled on a timer event, the button(s) are no longer visible
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:03
Joined
Oct 29, 2018
Messages
13,753
Hmmm...doesn't work for me - tested in A2010 & A365
As soon as the browser control is enabled on a timer event, the button(s) are no longer visible
Hi @isladogs. I said "disable," not "enable."
 

isladogs

CID VIP
Local time
Today, 09:03
Joined
Jan 14, 2017
Messages
14,268
OK - sorry - that doies work but of course, it defeats the whole point of using a web browser control as its no longer active.
In which case, you may just as well use an image control or ...as I previously suggested, place the command button near the web browser but not 'over' it.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:03
Joined
Oct 29, 2018
Messages
13,753
OK - sorry - that doies work but of course, it defeats the whole point of using a web browser control as its no longer active.
In which case, you may just as well use an image control or ...as I previously suggested, place the command button near the web browser but not 'over' it.
Understood about the drawbacks. However, from what I understand, the OP can't use a static image because the web page could have dynamic content. For instance, perhaps each time the form opens, the web page could be displaying a different diagram. So, I guess the other option is to somehow dynamically capture an image of the website and then use an image control instead. Maybe one of those "screen capture" routines for taking a snapshot of an error message could work for this. Either way, I think the intent was not to use a "live" web page because the user won't be "clicking" on its content. Rather, the OP wants the user to click on the buttons placed on the Access Form instead.
 
Last edited:

Micron

AWF VIP
Local time
Today, 04:03
Joined
Oct 20, 2018
Messages
3,471
Watching with interest and wondering why the mouse down suggestion just seemed to fall off the table in favour of a 'sometimes disabled, maybe no longer relevant to the page' buttons thingy...
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:03
Joined
Oct 29, 2018
Messages
13,753
The intention is perhaps unclear but ….
Post #8


Post #10
I agree, the actual intent is not very clear, but I took post #8 as follows:

HelpNewtoAccess said:
To open a form if you click on a button placed on top of an image on a live web page.

The part in red is what I read in between the lines, and the part in bold was why I thought a static image is not acceptable.

And for post #10, I'll have to look back, but I think that was a response to a suggestion of adding clickable areas on the web page itself.

Sent from phone...
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:03
Joined
Oct 29, 2018
Messages
13,753
Watching with interest and wondering why the mouse down suggestion just seemed to fall off the table in favour of a 'sometimes disabled, maybe no longer relevant to the page' buttons thingy...
Hi @Micron. I would like to know the answer to that question as well. I only had time to test my own idea for a suggestion I made earlier. If somebody else has the time to try the MouseDown solution, please let us know what you find out.

Sent from phone...
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 04:03
Joined
May 21, 2018
Messages
4,146
Hi @Micron. I would like to know the answer to that question as well. I only had time to test my own idea for a suggestion I made earlier. If somebody else has the time to try the MouseDown solution, please let us know what you find out
I looked at it and doubt it would work because of scrolling. If and only if, there was no scrolling it could it work. If that was the case then you could basically grid it out into a key pad. Lets say a 3x3, and the grids would be. So you could build a function to return what grid was clicked based on x and y.
1 2 3
4 5 6
7 8 9

In a table you could store what action to take if they clicked in grid 6 for an image. This way if the image changed you could add actions and update. I did this and it worked fine, but find it unlikely. If you want more functionality you can make more keys to the grid.
 
Local time
Today, 02:03
Joined
Dec 13, 2019
Messages
77
Thanks MajP,

What you've done sounds great, smart idea! Is it possible you could post a copy of the test db you tried this on so I can see how you put it all together?

theDBguy good simple idea and it could work maybe as an alternative to capture the image and values when they load but more interested in MajP solution.

Thanks for all the help..
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:03
Joined
Oct 29, 2018
Messages
13,753
Thanks MajP,

What you've done sounds great, smart idea! Is it possible you could post a copy of the test db you tried this on so I can see how you put it all together?

theDBguy good simple idea and it could work maybe as an alternative to capture the image and values when they load but more interested in MajP solution.

Thanks for all the help..
Hi. Sounds good. Good luck with your project.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 04:03
Joined
May 21, 2018
Messages
4,146
Here is a generic function that allows you to grid any control. Just define the number rows and columns
Code:
Public Type GridCell
  Row As Integer
  Column As Integer
End Type
Public Function GetCell(Ctrl As Access.Control, numberRows As Long, NumberColumns As Long, x As Single, Y As Single) As GridCell
  Dim cellWidth As Single
  Dim cellHeight As Single
  Dim i As Integer
  Dim j As Integer
  cellWidth = Ctrl.Width / NumberColumns
  cellHeight = Ctrl.Height / numberRows
  Y = Y - Ctrl.Top
  x = x - Ctrl.Left
  For i = 0 To numberRows - 1
    If Y > i * cellHeight And Y <= (i + 1) * cellHeight Then
      i = i + 1
      Exit For
    End If
  Next i
  For j = 0 To NumberColumns - 1
     If x > j * cellWidth And x <= (j + 1) * cellWidth Then
      j = j + 1
      Exit For
    End If
  Next j
   GetCell.Row = i
  GetCell.Column = j

End Function

So for each image you could have a table with what to do when a grid is clicked

TblImageGrids
-- imageID
-- gridCell ( I would store it like "3,9")
-- gridAction 'likely open a specific form


You may have to use application.run if your action is a procedure. I have never used it.


I am not real confident this is real feasible, but at least you can play with this.
However, like I said this does not make any sense once the image is scrolled. This idea could work with an image contrl, but then you would not need to do this with an image control.
 

Attachments

  • MajP_Test2.zip
    109.6 KB · Views: 23
Last edited:
Local time
Today, 02:03
Joined
Dec 13, 2019
Messages
77
Thanks for all the help and time... it's great!!
Just strugging a bit with the table to make it open a form based on the gridCell but I'll figure it out.
 

Users who are viewing this thread

Top Bottom