access & HTML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dani58
    New Member
    • Dec 2009
    • 7

    access & HTML

    I must copy values from fields in a Access (2003) form and send (paste?) these to fields in a form html showed in a browser.

    Is it possible? How? an example, please

    can I use the actvex Web Browser in Access form?

    Thanks in advance,

    dani
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    You should be using some sort of Server Side technology (like php, asp, asp.net) to do this. The server code will read from your access database, generate HTML, send this HTML to the browser, and listen for any submits (these could result in manipulating data in your access database).

    Oh wait...

    Unless you just want to generate HTML?

    Could you please explain in more detail what you are trying to do?
    Are you trying to develop a web application (website)?
    Or are you just trying to generate HTML?

    -Frinny

    Comment

    • dani58
      New Member
      • Dec 2009
      • 7

      #3
      thanks for your replay

      In a database Access I manage some information that every month I must have transmitted to a public Office.
      For the trasmission that Office has predisposed a form on a page html, with various fields (text, radio, check) that must be compiled with the data on my db Access.

      To manage all from the inside of the procedure in Access:
      1) I have a form in Access with the data
      2) I have positioned an activex web Browser in other form of Access, and I pass to it the parameter of the URL to which I have to connect, .
      3) the browser shows the page html with the form to compile.

      To this point I could compile with copy2clipboard and after pastefromClipbo ard, but I would like to be able to interact (button with OnClick event???) with the form html sending it the values in form Access by VBA and eventually, when I stop compilation, to read a value in the form html and to send it to the form of Access, always by VBA.

      The problem is for me, first of all, understand the name or id of the fields in the form html, and then as to modify them according to the values stored in form Access and vice versa.

      Too complicated?

      thanks, dani

      Comment

      • dani58
        New Member
        • Dec 2009
        • 7

        #4
        Can anyone help me with an idea or example?

        Thanks in advance, Dani

        Comment

        • topher23
          Recognized Expert New Member
          • Oct 2008
          • 234

          #5
          dani,

          You could use the Web Browser control to accomplish this. I've been working on a similar project over the past week.

          The methods of the web browser control are a bit different to work with, since it uses vbscript rather than VBA, but I'll give you a simple outline.

          We'll start with a form called frmBrowser. We'll put a WebBrowser control on it, called wbbBrowser.

          Now, to make your data enter into the page you want, you'll first have to get to the page. Put this in your form's OnOpen event:
          Code:
          Me.wbbBrowser.Navigate2 "[the URL you want]"
          Next, you'll need to look at the web page's source code to find the data entry control names you want. In order to enter your data into those controls, you'll use:
          Code:
          Me.wbbBrowser.Document.All.Item("[the control name]").Value = [the data to be entered]
          In the end, you'll probably need to click a 'Submit' button to save your data to the server. Command buttons in the web browser have a "Click" event, so you'll add:
          Code:
          Me.wbbBrowser.Document.All.Item("[the button name]").Click
          If you need any other help, just ask!

          Comment

          • Delerna
            Recognized Expert Top Contributor
            • Jan 2008
            • 1134

            #6
            It's quite difficult deciphering what you want
            But judging from your first post
            I must copy values from fields in a Access (2003) form and send (paste?) these to fields in a form html showed in a browser.
            I am guessing that you want to retrieve some values from a table in access and embed that data in a webpage requested by a user?

            If that is the case then make your page an asp page (or some other server side scripting language)
            Here is a simple example.
            You will of course need to modify it.
            [code=vbs]
            <html>
            <head>
            </head>
            <body>
            <%
            'HERE IS THE ASP PART

            set cnn=createObjec t("ADODB.Connec tion") 'Create a connection object
            cnn.provider="M icrosoft.Jet.OL EDB.4.0" 'For access
            cnn.open "Path/DataBaseName.md b" 'and connect it to your database
            set rst=createObjec t("ADODB.Record set") 'Create a recordset object
            set rst.open "SELECT Field FROM Table",cnn 'and retrieve some data via the connection object

            'Now loop through the recordset and add the data into an html table
            document.write( "<table>")
            while not rst.eof
            document.write( "<tr><td>" & rst.fields(0) & "</td></tr>")
            rst.movenext
            wend
            document.write( "</table>")
            %>
            </body>
            </html>
            [/code]

            Now all you have to do is give the office people a link to your asp page
            something like this ------- (Not a real link, by the way)

            and it will open in a web browser with the data displayed.

            I hope this is of some assistance to you?
            If not please ignore.

            Comment

            • dani58
              New Member
              • Dec 2009
              • 7

              #7
              many thank's Topher23,

              really as I wanted, I immediately try it.

              Best regards,

              Comment

              • dani58
                New Member
                • Dec 2009
                • 7

                #8
                I try to associate code
                Me.wbbBrowser.D ocument.All.Ite m("[the button name]").Click
                to automate the CLICK of button html, but the button don't have a name but only a [ID]; I try to substite [the button name]with its ID, but it don't works.

                What Can I to do?

                Regards, dani

                Comment

                • dani58
                  New Member
                  • Dec 2009
                  • 7

                  #9
                  and so how do I change value of one radiobutton into a group of radiobuttons with value from "A" to "E", with this example code html:
                  <th colspan="3" class="th.testa taBianca" align="left"><i nput
                  type="radio" id= "E" name="tipoSegn" value="E" onclick=" selectSegn('E') ;" />
                  xcxcxcxcxcxcxcx cxcx:</th>
                  many Thanks, Dani

                  Comment

                  • dani58
                    New Member
                    • Dec 2009
                    • 7

                    #10
                    Another problem.

                    unfortunately when I submit html page, html code try to open another Internet explorer session (not in webbrowser) with a form where I shoud put a value in a field, but from webbrowser new session don't open it.

                    Is there a method from Access to manipulate a session of internet explorer?
                    In sequence, for example:
                    1) from click in form Access, to open a session of I.E. (how?)
                    2) in I.E. session log user; the same window I.E. shows a form with a fields to compile and a button to submit
                    3) with a button in Access form send field1.value to I.E. active sessione (How?)
                    4) manually in I.E. form click submit button, and I.E. in the same window show another form to compile
                    5) from Access fields2.value, fields3.value, ecc send data to I.E. form
                    6) in I.E. form click on button to add a value in a special field; I.E. open a form in a new window with a field ad a butto to submit (How send here value from a specific field in access?). After submit, these window closed, and user can submit compiled form in the first I.E. window

                    Is it possible manipulate that?

                    Regards, dani

                    Comment

                    • topher23
                      Recognized Expert New Member
                      • Oct 2008
                      • 234

                      #11
                      In regard to the radio button, it looks like it has a Click event, so I'd try that. As to the other question, rather than using a web browser control, you can create an instance of internet explorer using automation, like so:

                      Code:
                      Dim AutoIE as Object
                          Set AutoIE = CreateObject("InternetExplorer.Application")
                      Check the msdn article on the InternetExplore r and WebBrowser objects for info on methods, properties, etc.

                      Comment

                      Working...