Free Lessons
Fast Tips
Topic Index
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
Home > TechHelp > Directory > Access > IP Addresses < Split Function | Change From Previous >
Back to IP Addresses    Comments List
How to Search by IP Address Upload Images   Link   Email  
Dan Pickle      
17 months ago
Please bear with me as I am new to Access but I need to know how to build a DB where I can put in IP addresses and search by those addresses.  Obviously I cannot just format a column as a number since an IP address has 3 decimals in it such as
Colin Levy         
17 months ago
Hi Dan

I only set a field as a number type if I intend to be able to do something mathematic with it. For example I would store 'quantity' as a number because I might need to work out a sum of quantities. But I would store a telephone number as short text because we don't normally do math on telephone numbers.

Likewise it's unlikely you would need to do math on the IP addresses. So I would store them in a field with type short text.
Colin Levy         
17 months ago
Sorry - hit submit a bit early. I was going to add - if I really wanted to be able to do any sort of calculations with an IP address, I would split it into the 4 octets in 4 separate fields.
Hope this helps, Colin.
Kevin Robertson            
17 months ago
I agree with Colin. Store the IP Address as Short Text.
Here is one way to search for a specific IP Address (see screenshot).
Kevin Robertson            
17 months ago

Dan Pickle      
17 months ago
Cool!  I'll give that a try tomorrow at work!
Dan Jackson              
17 months ago
Also try Search Form 2.0. Simplify it down for your needs!
Dan Pickle      
17 months ago
So I did try that today but sorting doesn't work correctly  Sorting goes from to to before it gets to
Dan Pickle      
17 months ago
and search form 2.0 is AWESOME!  I already used it on another project and it works GREAT
Dan Jackson              
17 months ago
Yeah, sorting wont work for your intention because its done as a string.

When the sorting treats it as a string, it goes:

. . .
. . .

And so on.

To sort correctly, it would need to be designated as a number (This is one of those mathematical things Colin was talking about). As he says, if you wanted complete control and 100% properly done, you would need to store each "Part" of the IP in a separate box. You could then use Concatenation in your search 2.0 form to display it as intended.

Something like
IP1 & "." & IP2 & "." & IP3 & "." & IP4
Would Produce from the 4 separate boxes and enable to you sort alpha numerically
Dan Jackson              
17 months ago
Yeah, I've only actually done 2 major releases and both used Search Form 2.0. Plus a bunch a smaller DB's for myself
Kevin Robertson            
17 months ago
You beat me to it Dan. LOL Took too long putting an image together. 😁
Kevin Robertson            
17 months ago

Dan Jackson              
17 months ago
Its Happenening! I'm becoming a pro!!!!
Dan Pickle      
17 months ago
If I split up the IP address into 4 cells though there would be no way to assign no duplicates to the field to make sure the same address is not used as a static address somewhere in our network
Alex Hedley             
17 months ago
{Composite Key}
Dan Jackson              
17 months ago
What Alex is referring to is Composite Keys

Essentially, you'd set all the required fields into a single indexed field (Called a composite key) which can then be dupe checked

This thread is now CLOSED. If you wish to comment, start a NEW discussion in IP Addresses.


The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.

Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
My Account
My Courses
Lost Password
Student Databases
Change Email
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Customer Support
Web Site Tour
Consulting Services
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/13/2024 10:57:32 PM. PLT: 1s