Extracting HTML values VBA Access

fgwapo

New member
Local time
Yesterday, 19:04
Joined
Oct 4, 2013
Messages
4
I have a table in msaccess which i would like to use as a search term to search values in another table. What i wanted to do is search the table with attributes and save all found attributes to a new table with its primary id.


Search_Keyword_Table
Id ---- Search_keyword
1 ----- Size - S
2 ----- Size - M
3 ----- Size - L
4 ----- Size - XL


Table to be searched
Id ----- Attributes
1 ----- <select name="attribute" id="attribute"><option value="Size - M">Size - M</option><option value="Size - L">Size - L</option></select>
2 ----- <select name="attribute" id="attribute"><option value="Size - S">Size - S</option><option value="Size - M">Size - M</option><option value="Size - L">Size - L</option></select>


Saved table results
Id ---- Attributes_found
1 ---- Size - M
1 ---- Size - L
2 ---- Size - S
2 ---- Size - M
2 ---- Size - L




Any help is highly appreciated
fgwapo
 
as far as I know you cannot (yet) import HTML directly into access. To process this you will need to open the file in code and read it character by character / word by word to find what values you want.

Shouldnt be too hard to do
 
Using string functions http://www.techonthenet.com/access/functions/ you can find whether a string appears as substring in another string.

So you open a recordset in your table to be searched, and open the recordset with the strings to be searched for. For each record in the search table loop over the strings contained in the keyword table to see if they exist or not. Each found instance, you can run a query to insert that in result table, or add the record directly in the opened recordset.

Google: loop Access recordset, if you don't know how.
 

Users who are viewing this thread

Back
Top Bottom