Results 1 to 6 of 6
  1. #1
    JeffG3209 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Location
    Weatherford, Texas
    Posts
    66

    Hyperlinking is for the birds :)

    Alright. I have been using hyperlinks like this
    Code:
    ="http://www.google.com/search?q=" & [FIRST NAME] & " " & [BUSINESS NAME] & " " & [CITY] & " " & [STATE]
    However, I have realized this is not my best method. With some of my detailed searches I run into the problem that the url does not display the fields.

    Example:
    If I open google maps and try a search for "Texas" the url remains http://maps.google.com/ instead http://maps.google.com/q=Texas of I believe this is called a static page.

    How can I learn how to command Access to input fields into a search box and press enter. I know it doesn't actually do all of that, but you get the point.



    I have tried using the search feature and google, but I don't even know the technical terms. Thanks!

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    this might shed some light: http://www.access-programmers.co.uk/...d.php?t=176968

    I wrote that years ago. But are you also aware that 07 and above has web browser controls? to manipulate it inside of a form, it has the exact same (or close) structure as the DOM (document object model), which is the "language" that you see being used on webpages. e.g. - HTML and javascript. Try that Active X control first.

    For one thing, it's easier to use that than having to deal with an actual IE window anyway.

    the other thing you might remember is that some sites do not allow you to type stuff into the URL bar. if the server scripts have prevented that kind of thing, or prevented other techniques of not utilizing the input objects like forms, things that you try might fail.

  3. #3
    JeffG3209 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Location
    Weatherford, Texas
    Posts
    66
    ajetrumpet,

    I have played with the web browser control. It is pretty cool, I guess that I will dig a little deeper into it. I am familiar with HTML as this is where I got my start with computers about 4 years ago. This should be a pretty easy win. I checked out that hyperlink and that is some good stuff. Awesome, thanks!

  4. #4
    JeffG3209 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Location
    Weatherford, Texas
    Posts
    66
    Can you double check me? I can't seem to find my error
    Code:
    Private Sub Command532_Click()
    Dim ie As Object
    Set ie = CreateObject("internetexplorer.application")
    
    ie.Visible = True
    ie.Navigate "https://ourcpa.cpa.state.tx.us/coa/Index.html"
     While ie.Busy
                DoEvents
             Wend
    ie.Document.getElementById("Search by Name").Value
    ie.Document.getElementById("Search by Name").Value = "[BUSINESS NAME]"
    
    ie.Document.all("Search by Name").Click
    
    End Sub

  5. #5
    JeffG3209 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Location
    Weatherford, Texas
    Posts
    66
    Quote Originally Posted by JeffG3209 View Post
    Can you double check me? I can't seem to find my error
    Code:
    Private Sub Command532_Click()
    Dim ie As Object
    Set ie = CreateObject("internetexplorer.application")
    
    ie.Visible = True
    ie.Navigate "https://ourcpa.cpa.state.tx.us/coa/Index.html"
     While ie.Busy
                DoEvents
             Wend
    ie.Document.getElementById("Search by Name").Value
    ie.Document.getElementById("Search by Name").Value = "[BUSINESS NAME]"
    
    ie.Document.all("Search by Name").Click
    
    End Sub
    I attched somre images to make it easier. Once I learn once, it's all downhill from there. Thanks for your support!

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by JeffG3209 View Post
    Can you double check me? I can't seem to find my error
    Code:
    Private Sub Command532_Click()
    Dim ie As Object
    Set ie = CreateObject("internetexplorer.application")
    
    ie.Visible = True
    ie.Navigate "https://ourcpa.cpa.state.tx.us/coa/Index.html"
     While ie.Busy
                DoEvents
             Wend
    ie.Document.getElementById("Search by Name").Value
    ie.Document.getElementById("Search by Name").Value = "[BUSINESS NAME]"
    
    ie.Document.all("Search by Name").Click
    
    End Sub
    bud,

    "getElementById" is a javascript method. obviously from the name, you know that you can't use the "name" attribute with that method. you have to use the "id" attribute. If there is none for any given html tag in a source code page, you're out of luck.

    INPUT tags have types. the SUBMIT type is the button. the NAME attribute of that button is the text you see on it. and this code:

    Code:
    ie.Document.getElementById("Search by Name").Value = "[BUSINESS NAME]"
    should NOT have quotes around your field name.

    if that box doesn't have an ID in the code, see my page for other ways on how to get it's index reference number in order to assign a value to it. also see the section on button and submitting forms. you can POST forms in more than one way. you don't have to click buttons. you can use the SUBMIT method of the FORM tag.

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums