Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    live2ride is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    70

    fill online forms using Access

    i would like to fill out online forms using access. closest to what i found out so far is WebBrowser, and while using WebBrowser i can navigate to website but thats as far as i got.
    how can i find out what text boxes are named on webpage and how can i fill those text boxes out?



    lets say for simplicity sake i would like to use www.google.com to search for something like "555", how can i accomplish this?


    it took me a while to figure out how to enable WebBrowser so i want to post here to help others.
    using access 2007 reference is Microsoft Web Browser which once selected changes to Microsoft Internet Controls
    go to VBA pres Alt + F11, TOOLS, Referrence and select Microsoft Internet Controls, for html make sure you enable Microsoft HTML Object Library
    once i did this i was not able to see Web Browser Control on access 2007
    then while in VBA press CTRL + T which takes you to Components, in there select Microsoft Internet Controls
    this should enable Web Browser Control in menu Design / Controls

  2. #2
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    I'm not in the office right now, but I've talked about this in depth.. Tomorrow morning I can post a link for you.

  3. #3
    live2ride is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    70
    thank you so much, i found very few links and tried few instances of which none worked, hopefully your link will help. thanks

  4. #4
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Well I did find this...
    https://www.accessforums.net/general...ase-27053.html

    There is an MDB file on there that you can pull and use / modify. It holds all my code for navigating websites. Also kind of goes into the pitfalls of it as well. Some sites are SUPER easy, and others are a pain in the freakin arse... But I'm off to bed, lemme know if this helps, or if you need anything additional.

  5. #5
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    the mdb is on the first post on the second page.

  6. #6
    live2ride is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    70
    at work im using access 2007 so i guess this feature is not available but i would still like to mess with it at home, where i have access 2007

    im at work now so i wasnt able to open your file and look at the code, but what i would like to know is how do you know which fields your vba needs to search for. lets take www.google.com for example, how do you know the name of the search box
    im using firefox and i have firebug but i dont know anything about html so if i go to google and look at the code how to do i find and know which text box is actually "search" field

  7. #7
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Ahh, alright... Well I primary use IE for this kind of thing... so what I do is get to the webpage you want in IE

    in IE, hit F12. This will open up the dev tools.

    In dev tools you will see a little mouse icon in the top left. click it.

    Go BACK to the web page... you will notice things are highlighted while you hover over them..

    Click on the search box, and then look back at the DEV tools and it will show you the line you clicked... The easy things are labeled like "ID" or "name"

    But in googles case.....


    HTML Code:
    <input name="q" class="gbqfif" id="gbqfq" style="z-index: 6; border-bottom: medium none; position: absolute; border-left: medium none; padding-bottom: 0px; margin: 0px; outline-style: none; outline-color: invert; padding-left: 1px; outline-width: medium; width: 100%; padding-right: 1px; background: url(data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw%3D%3D); HEIGHT: auto; border-top: medium none; border-right: medium none; padding-top: 0px; left: 0px;" dir="ltr" type="text" __jsaction="[object Object]" autocomplete="off" nfd="true" oninput="function(a,c){if(r.length){var d;if(!(d=a)){d={};var e=g.event;e&&(e.keyCode&&(d.keyCode=e.keyCode),d.no=_.m)}d.Qc=c||b;for(var e=d,f,t,h=0,l;l=r[h++];)l.Df?t=_.m:f||(l.oo?p(l,e):f=l.Ub(e));if(t)for(h=0;l=r[h];)l.Df?r.splice(h,1):++h;if(d.$d)return delete d.$d,d.no&&(d=g.event||d),_.Q.Va(d),d.returnValue=_.z}}" oncompositionstart="function(a,c){if(r.length){var d;if(!(d=a)){d={};var e=g.event;e&&(e.keyCode&&(d.keyCode=e.keyCode),d.no=_.m)}d.Qc=c||b;for(var e=d,f,t,h=0,l;l=r[h++];)l.Df?t=_.m:f||(l.oo?p(l,e):f=l.Ub(e));if(t)for(h=0;l=r[h];)l.Df?r.splice(h,1):++h;if(d.$d)return delete d.$d,d.no&&(d=g.event||d),_.Q.Va(d),d.returnValue=_.z}}" oncompositionend="function(a,c){if(r.length){var d;if(!(d=a)){d={};var e=g.event;e&&(e.keyCode&&(d.keyCode=e.keyCode),d.no=_.m)}d.Qc=c||b;for(var e=d,f,t,h=0,l;l=r[h++];)l.Df?t=_.m:f||(l.oo?p(l,e):f=l.Ub(e));if(t)for(h=0;l=r[h];)l.Df?r.splice(h,1):++h;if(d.$d)return delete d.$d,d.no&&(d=g.event||d),_.Q.Va(d),d.returnValue=_.z}}" spellcheck="false"/>
    the Search box has an ID of "gbqfq" so in the code, that is the element you should be tickling... it ultimately would end up like.....

    oie.document.body.item"gbqfq".value = "And here you can put in anything... a form text box, a table entry, etc etc"

    So that would paste the code into the search bar... now we have to SEARCH it...


    The search button has an id of gbqfba.... so it would gooo...

    oie.document.body.item"gbqfba".click

    OR .submit

    Java and Frames on a website can make VBA navigation VERY tedious and sometimes just not possible. What I do, if a site is giving me a ton of crap... I try navigating their mobile sites, because those sites are generally less robust.

  8. #8
    live2ride is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    70
    thanks for that info very useful.
    im trying to add webBrowser to access 2007 but i dont see the control. i enable reference and components and i still dont see the Web Browser Control. if i create it in Access 2010, i cant open that file in Access 2007, is WebBrowser not available in access 2007 or am i missing something?

  9. #9
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Oh, you mean the embedded browser thing? I don't use that I have the code open and scrape/navigate a new instance of IE.

  10. #10
    live2ride is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    70
    nice, i will have to look into once i get home

  11. #11
    live2ride is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    70
    i looked at your code and works great, thats what i needed BIG thanks

  12. #12
    live2ride is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    70
    tried setting value to field Title and got error
    <input tabIndex="0" class=" x-form-field x-form-text" id="x-auto-16-input" submitName="null" style="width: 695px;" __eventBits="6144" _id="Title"/>

    Run-time error 91 'Object variable or With block variable not set' on line
    i tried using id= and _id= but no luck
    ie.Document.all.Item("Title").Value = Me.Title
    ie.Document.all.Item("x-auto-16-input").Value = Me.Title
    any ideas?

  13. #13
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    able to post the database on here? I can take a look at it. Until I get my post answered I am kind of at a stopping point.. I am having a problem with trims!
    So yea, post what you have and I can take a look!

  14. #14
    live2ride is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    70
    its the same code you were using just simplified so i can go one step at a time for troubleshooting
    Dim ie As InternetExplorer
    Dim webSite As String

    webSite = "www.website.com"
    Set ie = Login(webSite, True)

    Call SleepIE(ie)
    ie.Document.all.Item("Title").Value = "testing

  15. #15
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    https://www.accessforums.net/program...rim-29578.html

    Take a look at my problem... Yea, I'm not very familiar with instr

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 07-09-2012, 07:19 AM
  2. I need access developer online
    By mid_boos in forum General Chat
    Replies: 7
    Last Post: 11-09-2011, 11:31 AM
  3. Fill out forms
    By nycon in forum Access
    Replies: 1
    Last Post: 06-23-2011, 02:45 AM
  4. Access Installed? How to check it online.
    By Thopaga in forum Access
    Replies: 2
    Last Post: 12-09-2010, 02:24 PM
  5. Taking an access database online
    By anthony_f_justin in forum Access
    Replies: 2
    Last Post: 12-29-2005, 01:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums