473,387 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Need help with IE selecting drop down

BHo15
143 128KB
I am trying to select from a dropdown in IE from Access VBA. You cannot right click on the dropdown and inspect element. I ended up using something on found online, and it worked for a while, but it has now stopped working. Here is what I was using...

Expand|Select|Wrap|Line Numbers
  1. IEWindow.Document.querySelector("div[id=pagecontents] div[class=container] div[id=resultOptions] form[name=resultOptions] select[id=selectResult]").Focus
  2. IEWindow.Document.querySelector("div[id=pagecontents] div[class=container] div[id=resultOptions] form[name=resultOptions] select[id=selectResult]").selectedIndex = 4
  3. IEWindow.Document.querySelector("div[id=pagecontents] div[class=container] div[id=resultOptions] form[name=resultOptions] select[id=selectResult]").dispatchEvent evt
If I remember correctly, the error that occured is that it could not find the object (presumably the IE control that is referenced).

I then found another way to find that dropdown, and it appears that it is a control called selectResult (see the HTML below).

Expand|Select|Wrap|Line Numbers
  1. <div id="page-header">_</div>
  2. <!-- end of PAGE HEADER -->
  3. <-- PAGE CONTENTS -->
  4. <div id="pagecontents">
  5.    <div class="container">
  6.        <div class="panel panel-default scc-scanengine-panel" id="scc-scanengine-criteria">_</div>
  7.        <div id="resultOptions">
  8.           <form name="resultOptions">
  9.              <span class="form-item-label">Available Actions</span>
  10.              <select id="selectResult">
  11.                 <option selected="selected" value="none">- Choose -</option>
  12.                 <option value="new">Store these results in a new C_</option>
  13.                 <option value="merge">Merge these results with an ex_</option>
  14.                 <option value="replace">Replace an existing ChartList _</option>
  15.                 <option value="csv">Download In CSV Format</option>
  16.              </select>
  17.           </form>
  18.         </div>
  19.         <script type = "text/javascript">,!-- var sortOrder = "USAD"; _</script>
  20.         <form name="submitForm" action="/def/servlet/SC.uscan" method="post">_</form>
  21. <!-- TABLE DATE ROW -->
  22. <div class="dt-date-row">_</div>
  23. </div>
For those that are good at HTML... Please don't shoot me. I had a screen print of the HTML, and then I tried to type it out.

So... The problem is that I am having trouble connecting to the IE control (the dropdown box). Then, when I connect to it, I need to be able to select the csv option (which I'm assuming is option 4 if zero based).

Thoughts?
Aug 21 '19 #1
10 1536
BHo15
143 128KB
I lot of views on this? Anyone able to help?
Aug 23 '19 #2
NeoPa
32,556 Expert Mod 16PB
Unlikely I would expect. The numbers of Access programmers who have experience controlling IE from VBA is probably very small relatively. I'm only surprised you seem to expect otherwise.

Good luck and all, but I can't hold out a great deal of hope in the circumstances.
Aug 24 '19 #3
BHo15
143 128KB
Oh well. It was a good thought.
Aug 24 '19 #4
NeoPa
32,556 Expert Mod 16PB
Never hurts to try. Just bear in mind this is an Access forum so is likely to have mainly Access people reviewing it.

It's not impossible that some might have the experience you need but it's necessarily going to be a small fraction of those here.
Aug 24 '19 #5
BHo15
143 128KB
I’ve been working in Access for about 15 years, and though it’s rare, I have had need to write VBA FOR IE, so I was just hoping that others did as well. Bytes is my favorite message board for Access and VBA. So I always like to start here.
Aug 24 '19 #6
NeoPa
32,556 Expert Mod 16PB
Makes good sense. Just don't be too disappointed when you find you're now that expert ;-)
Aug 25 '19 #7
Rabbit
12,516 Expert Mod 8TB
Seeing as how you there's an id, you can use the more straightforward getElementById() function instead of querySelector().
Aug 26 '19 #8
BHo15
143 128KB
Yes sir, I tried that, and it is still not connecting correctly. It keeps saying "object required".
Aug 26 '19 #9
Rabbit
12,516 Expert Mod 8TB
Try running Access as an admin. I've noticed that trying to script IE will tend to disconnect from the object unless I'm running the script as admin
Aug 26 '19 #10
BHo15
143 128KB
Interesting Rabbit. I never would have guessed that. I'll give it a go.
Aug 27 '19 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: PT | last post by:
I got a form with many text boxes, checkboxes and 3 drop downs. From that 3, 2 are dependant. I can choose one drop down, and the next drop down should display the dependant values of the first...
1
by: John Doe | last post by:
I've made this simple menu using a javascript : http://larsandre.mine.nu/menu.htm If I select one of the menu items the submenu appears just fine, my only problem is that If I point the mouse...
2
by: delerious | last post by:
I'm going to build a vertical navigation menu using images in HTML. I want to have a drop-down menu appear next to an image when I move the mouse over it. I know that I could just download any one...
2
by: Joey Liang via DotNetMonster.com | last post by:
Hi all, I am new in asp.net, i encounter some problems in using drop down list and datagrid. I have manage to bind the data into datagrid but i wanted to bind the data into the datagrid accroding...
6
by: Joey Liang via DotNetMonster.com | last post by:
Hi all, I have a drop down list which store all the different brands of product.When i selected the particular brand from the drop down list, it will display all the products with the selected...
7
by: callawayglfr | last post by:
I am building a database in access where I have a drop down box that relates to a text box, that part I have working but when someone selects information from the first drop down I need it to limit...
0
by: aboutjav.com | last post by:
Hi, I am new at asp.net and want to add a horizontal dropdown menu like toolstripmenu in windows form. I found a drop down menu written in javascript (DHTML). How do I add to my asp.net project....
3
by: happyman992 | last post by:
Hi, I have 2 questions. First, I am building a form with multiple drop down boxes. The options of the second drop down box will depend on what the user chooses on the first, options of the third...
1
by: swathin2 | last post by:
hello everybody, i am trying to learn php on my own and i have an issue with the drop down box in php. i would like to use 3 drop down boxes one for the state, second for the district and the...
1
greeni91
by: greeni91 | last post by:
Hi all, I am using a database at my workplace that has over 3000 records and I have been told to make queries for it. As of now i have the queries complete and I am compiling the macros to run...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.