Results 1 to 4 of 4
  1. #1
    dniezby is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Apr 2013
    Posts
    183

    Button code for IP location

    I have a button on one of my forms that I want to program to give my DB user the location of an IP Address. Anyone have a way to code this into a button?



    Here is the deal.

    On my form, I have a field - USER IP which tells my DB user the IP address a contact's email and information was collected. I would like my DB user to be able to click a button next to that IP address field and have it return with some type of response that says responds with location and (hopefully) timezone. (IE : Chicago, IL - -6 GMT or even "Chicago, IL. - CST)

    Can this even be done?

    I hope someone already has some code for it.

    Thanks again in advance.

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,409
    Look here:
    https://db-ip.com/db/https://db-ip.com/db/
    A couple of the DLs appear to be free.

  3. #3
    dniezby is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Apr 2013
    Posts
    183

    Question

    Quote Originally Posted by davegri View Post
    Look here:
    https://db-ip.com/db/https://db-ip.com/db/
    A couple of the DLs appear to be free.
    Holy cow! That's way more than what I'm looking for. Data I don't really want to bloat my DB with. It's not THAT important. Just thought it would be a cool feature.

    I did find this site http://freegeoip.net

    It says it takes http get requests like this
    Code:
    freegeoip.net/{format}/{IP_or_hostname}
    I just don't know how to program the button with something like this nor how to handle the results if I did.

    Any ideas?

  4. #4
    dniezby is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Apr 2013
    Posts
    183
    After reading that site, I think I figured out how to do what I want.

    Here is what I did.

    Made a button with this onclickevent
    Code:
    Private Sub btn_iplookup_Click()
    Me.btn_iplookup.HyperlinkAddress = "http://freegeoip.net/?q=" & Me.IP
    Me.btn_iplookup.Hyperlink.Follow True
    Me.btn_iplookup.HyperlinkAddress = ""
    
    End Sub

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

Similar Threads

  1. Replies: 1
    Last Post: 03-31-2016, 08:31 AM
  2. Replies: 3
    Last Post: 10-20-2014, 03:25 PM
  3. Replies: 3
    Last Post: 10-16-2014, 08:49 AM
  4. Replies: 3
    Last Post: 06-04-2013, 09:51 AM
  5. Replies: 0
    Last Post: 01-11-2012, 12:34 PM

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