Submit an HTML Form through Access VBA

Discussion in 'Software' started by douglazb, Jan 23, 2014.

  1. douglazb

    douglazb Private E-2

    Greetings -

    I have written the following form inside an Access Database form.

    Code:
    Function Submit_Web_Form()
    
    Dim ie As Object
    
    Set ie = CreateObject("internetexplorer.application")
    
      ie.navigate "http://www.webstaurantstore.com/bakers-pride-bco-e2-cyclone-series-electric-convection-oven-double-deck/155BCOE2.html"
    
      ie.Visible = True
    
      While ie.busy
        DoEvents
      Wend
    
    ie.Document.all("from").Value = "Add"
    ie.Document.all("weight").Value = "0"
    ie.Document.all("price").Value = "5400.00"
    ie.Document.all("description").Value = "Bakers%20Pride%20BCO%2DE2%20Cyclone%20Series%20Electric%20Convection%20Oven%20Double%20Deck"
    ie.Document.all("uom").Value = "Each"
    ie.Document.all("shipping").Value = "C"
    ie.Document.all("taxcode").Value = "Y"
    ie.Document.all("mnbuy").Value = "1"
    ie.Document.all("mxbuy").Value = "1"
    ie.Document.all("suffix").Value = "Voltage"
    ie.Document.all("group").Value = "Y"
    ie.Document.all("item_number").Value = "155BCOE2    240/1"
    ie.Document.all("qty").Value = "1"
    ie.Document.Forms(0).submit
    
      While ie.busy
        DoEvents
      Wend
    
    Set ie = Nothing
    
    End Function
    
    While the function does not produce any errors, but it does not submit the form. I need to automate adding products into the shopping cart.

    Does anyone have any experience working with an web page through VBA?

    Thanks in advanced!
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds