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

    Any thoughts why "IF" isn't working right?

    Anyone know why this doesn't work?

    Well, let me rephrase it doesn't work correctly. It DOES go and check the IP address like it should HOWEVER, it's not checking to see if the IP field is empty.

    I want the button to check the field IP to see if there actually IS an entry. If not, pop a message box up go back to the form. Else, run the query on the website. This DOES run the query but it's not checking the field. I leave it blank and it still tries to search.

    Code:
    Private Sub btn_iplookup_Click()
    If Me.IP = Null Then
        MsgBox "No IP Address Found", vbOKOnly
    Else
        Me.btn_iplookup.HyperlinkAddress = "http://freegeoip.net/?q=" & Me.IP
        Me.btn_iplookup.Hyperlink.Follow True
        Me.btn_iplookup.HyperlinkAddress = ""
    End If
    
    End Sub
    Any help would be greatly appreciated.
    Thanks.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    You don't = null,
    it's:
    if IsNull(me.IP) then

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    try

    If isnull(Me.IP) Then

  4. #4
    dniezby is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Apr 2013
    Posts
    183
    OMG. LOL thanks that worked. I did the isNull too but I didn't have the syntax correct. Thanks...It worked.
    LOVE this Forum.

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

Similar Threads

  1. Replies: 3
    Last Post: 09-14-2015, 02:04 PM
  2. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  3. Replies: 1
    Last Post: 06-29-2014, 11:42 PM
  4. Replies: 2
    Last Post: 01-15-2014, 07:57 PM
  5. Replies: 4
    Last Post: 08-14-2012, 11:56 AM

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