Data Entry from Userform to Web Form: Check all fields before submitting?

Peter h

Active Member
Joined
Dec 8, 2015
Messages
417
I've got a userform that I use to submit data to a web form. I've recently started having issues with it not submitting the data to the web form. It happens intermittently, and not every time, so it makes me think that it might be more network issues causing a hiccup than my actual code. So I wrote some code that after the data is submitted, it opens the webform again and checks to see what the last entered data set was. This seems a bit slow, and I feel like there should be a better way to write a check code.

So right now, I've got a combination of a minimum of 11 comboboxes and textboxes in my user form. When I click the submit button the code executes these actions
-opens the web
-navigates to the url
-enters the data into the corresponding fields
-clicks the submit button on the webform
-closes IE
-Opens IE
-navigates to the url
-checks that the last entered data set was what I just entered
-closes IE

If something happened that for some reason the entered data doesn't match what I had just entered then it will give me a messagebox telling me that something happened.

I think this can be simplified because closing the web and reopening it to do my check just seems very inefficient. What I'm thinking about doing is an if statement after it enters the data into the corresponding fields on the web form. So it would be something like If field 1 = Textbox1 then click the submit button. This seems like it might be better than my current check code, but I would have to write it like: "If IE.getElementById("Field1").Value = Textbox1.Value And IE.getElementById("Field2") = Textbox2.Value etc etc, through all 11 controls" Is there a better or shorter way of doing this?
 
Last edited:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,246
Messages
6,170,988
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top