Results 1 to 11 of 11

Thread: www.upcdatabase.com

Hybrid View

  1. #1

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: www.upcdatabase.com

    VB Code:
    1. Option Explicit
    2. 'Add component to Microsoft HTML Object Library
    3. 'Add component Microsoft Internet Controls
    4.  
    5. 'Add a command button (Command1)
    6. 'Add a web browser control to the form (wbbWebsite)
    7. Dim hDoc 'As MSHTML.HTMLDocument
    8. Dim hCol 'As MSHTML.IHTMLElementCollection
    9. Dim hInp 'As MSHTML.HTMLInputElement
    10. Dim hSub 'As MSHTML.HTMLInputButtonElement
    11. Dim hTxt 'As MSHTML.HTMLInputTextElement
    12. Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
    13. Private Sub Form_Load()
    14.     'Application.Screen.MousePointer = 11 ' Hourglass
    15.     'wbbWebsite.Navigate URL:="http://www.upcdatabase.com/nocheckdigit.pl"
    16.     'MsgBox "**** You"
    17.     'Application.Screen.MousePointer = 0 ' Back to normal
    18.     wbbWebsite.Navigate URL:="http://www.upcdatabase.com/item.pl?upc"
    19.     MsgBox "Hello"
    20. End Sub
    21. Private Sub Command1_Click()
    22. wbbWebsite.Navigate URL:="http://www.upcdatabase.com/item.pl?upc"
    23. MsgBox "Hello"
    24. Set hDoc = wbbWebsite.Document
    25.     Set hInp = hDoc.getElementById("upc")
    26.     'hInp.focus
    27.     'upc = "064144043248"
    28.     hInp.Value = upc
    29.     Set hInp = Nothing
    30.     'Parse the elements and read the values of the data returned
    31.     'Set document variable = to the new results documents page
    32.     Set hDoc = wbbWebsite.Document
    33.     'Find the description:
    34.     'iStart = InStr(1, hDoc.body.innerHTML, "<TD>Description</TD>") + 37
    35.     'iEnd = InStr(iStart, hDoc.body.innerHTML, "</TD></TR>")
    36.     'MsgBox Mid$(hDoc.body.innerHTML, iStart, iEnd - iStart)
    37. End Sub
    38. Private Sub Command2_Click()
    39. On Error GoTo Err_Command2_Click
    40.     Dim stDocName As String
    41.     stDocName = "food"
    42.     DoCmd.OpenDataAccessPage stDocName, acDataAccessPageBrowse
    43. Exit_Command2_Click:
    44.     Exit Sub
    45. Err_Command2_Click:
    46.     MsgBox Err.Description
    47.     Resume Exit_Command2_Click
    48. End Sub
    49. Private Sub upc_Change()
    50.     wbbWebsite.Navigate URL:="http://www.upcdatabase.com/item.pl?upc"
    51.     MsgBox "Hello"
    52.     Set hDoc = wbbWebsite.Document
    53.     Set hInp = hDoc.getElementById("upc")
    54.     hInp.Value = upc
    55.     Set hInp = Nothing
    56. End Sub
    Attached Files Attached Files
    Last edited by bob5731; Oct 13th, 2005 at 02:12 PM.
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width