Solved Web Browser Controls : A never ending struggle. (4 Viewers)

As I said, I edited your database in #9.
The only edit I did was
Changed this line:
pdfBrowser.Height = 8000
to:
pdfBrowser.Height = wBrowser.Height

Your database stopped working. Give it a try.

I'll follow your instructions in the morning
Thanks again

I had tested before I posted.
Just to be clear, I was referring to changes to your original form from post #1.

Or using the modified version of your form from post #9, change the code to:

Code:
Private Sub Detail_DblClick(Cancel As Integer)   

    Dim pth As String
    Static Indx As Integer   

    Select Case Indx
        Case 0
            Indx = 1
        Case 1
            Indx = 2
        Case 2
            Indx = 3
        Case 3
            Indx = 1
    End Select

    pth = "https://msaccess/" & CurrentProject.Path & "\" & Indx & ".pdf"

    With pdfBrowser
        .ControlSource = pth
        .Height = wBrowser.Height
        .SetFocus
    End With       

End Sub

Private Sub Form_Open(Cancel As Integer) 

    pdfBrowser.Top = wBrowser.Top
    pdfBrowser.Height = 0   

End Sub

I hope you don't see or respond to this until the morning (Japan time) 😉
 
I don't use anydesk but It works for me - no delay - see attached
@CJ_London
First, I’m truly sorry that I missed your second post.
Second, please accept my sincere apologies. I tested your solution again this morning, and it’s working perfectly. I honestly don’t know why the homepage didn’t show up when I tested it last night. It may have been because I was using a remote desktop app (AnyDesk) to access my office PC, and something went wrong on my end.

I feel really bad for reporting an incorrect result. That was completely my mistake, and I’m genuinely sorry for any confusion I may have caused.
I will correct my previous post, in case anyone in future visits this page.

Thanks again.

@isladogs It seems that @CJ_London has found a solution that solves the problem, yet not working on heights. (#6 Post)
 
I had tested before I posted.
Just to be clear, I was referring to changes to your original form from post #1.

Or using the modified version of your form from post #9, change the code to:

Code:
Private Sub Detail_DblClick(Cancel As Integer)

    Dim pth As String
    Static Indx As Integer

    Select Case Indx
        Case 0
            Indx = 1
        Case 1
            Indx = 2
        Case 2
            Indx = 3
        Case 3
            Indx = 1
    End Select

    pth = "https://msaccess/" & CurrentProject.Path & "\" & Indx & ".pdf"

    With pdfBrowser
        .ControlSource = pth
        .Height = wBrowser.Height
        .SetFocus
    End With   

End Sub

Private Sub Form_Open(Cancel As Integer)

    pdfBrowser.Top = wBrowser.Top
    pdfBrowser.Height = 0

End Sub

I hope you don't see or respond to this until the morning (Japan time) 😉
@isladogs Thanks for additional details.
Now I'm set and the my form looks perfect. I really appreciate your help.

One final (I promise, It's the last) favor.
Whenever you have 5 minutes free time, would you please test the database attached to this post?
Does it work for you? It seems it can not show the second and later PDFs.
(It's your own file, I simply changed the Height line)

Again, Million thanks.
 

Attachments

Last edited:
You forgot to disable or remove the final line which had set wbrowser to 0 on the first double click. So on the second double click, the pdfbrowser height also becomes 0 and only shows as a thin grey line! If you look at my code above, I had removed the line ;)

Attached is the working version with that change saved as form Form2Edge_FIXED_v2.

I've also reinstated my own version of the form which deliberately opens to my Web article on modifying the hosts file to speed up the loading of local files. I thought it might be useful to both you and others!
 

Attachments

One of the greatest advantages Access had over its competitors, beyond its ease of us, was its consistency. You could build a database and expect it to run flawlessly through multiple generations of Windows and Office updates, performing just as it did on day one.

Lately, however, that confidence has been replaced by uncertainty. Instead of stability, we now worry about what might break with the next update. Each new update brings not anticipation, but concern about what might stop working next.
I agree with the sentiment: I'm on 2021 but even normal changes are problematical. MS is becoming a bit bit like Boeing when changes are rushed out without proper testing. The mantra a good friend of mine who ran our testing group was that no matter how small the change you test the whole application, not just the change.
 
Last edited:

Users who are viewing this thread

  • Back
    Top Bottom